In this lesson we will introduce important aspects of software engineering, specifically version control with Git and testing.
This material is based on two CodeRefinery lessons:
In this part of the lesson we will see why everyone should be using version control, and become comfortable using Git to stage and commit changes, create and merge branches and resolve conflicts.
In this part of the lesson we will discuss why testing needs to be part of the software development cycle and how such a cycle can be implemented. We will exercise a collaborative testing/code review workflow.
If you are using the virtual machine provided to you at the summer school, you will only need to consider point 2 below.
15 min | Motivation for version control |
Why do I need version control?
What does an online repository look like? |
30 min | Basics |
What is Git?
What is a repository? How does Git operate? How do I make commits? How do I select what to commit? |
30 min | Branching and merging |
How can I or my team work on multiple features in parallel?
How to combine the changes of parallel tracks of work? How can I permanently reference a point in history, like a software version? |
25 min | Conflict resolution |
How can we resolve conflicts?
How can we avoid conflicts? |
5 min | Where to go from here | Where to go from here? |
10 min | Break | Break |
10 min | Motivation for testing | Why should we write tests? |
5 min | Concepts |
What are unit tests, regression tests, and integration tests?
What is test coverage? How should we approach testing? |
5 min | Tools | What tools are out there? |
15 min | Exercise: Testing with pytest |
How can we implement a test suite using pytest?
I am a Fortran developer, do I need to care about pytest? |
15 min | Exercise/discussion: Testing using hooks | How can we use Git hooks to make sure we do not commit broken code? |
20 min | Exercise: Automatic testing with Travis CI | How can we implement automatic testing each time we push changes to the repository? |