Styles of development
This handout is tied to the following lecture
7. Styles of developmentDevelopment Styles
There are many different styles of development, e.g.
- Iterative design
- Iterative and incremental development
- Test-driven development
- V
- Software prototyping
- Continuous deployment or Continuous delivery
- Scrum
- Waterfall
- Agile
- Lean & Kanban
- And probably a bunch more
Although, for us scientists I believe really only a select few are relevant, which are also the ones covered in the lecture.
A few brief explanations of relevant styles can be found in the videos below since the articles above can be quite long and wordy.
TheAgileBroadcast - Is agile incremental or iterative?
ProDeveloper - Software Development Methodologies Introduction
Geoffrey Hubona - Chapter 2.2 Waterfall, Parallel, and V-model Approaches
Eye on Tech - What is the Agile Manifesto? An Introduction
Project management tools
Homework
A calculator
Write a general purpose calculator that can parse any single line calculation with *, +, -,
and /. If it is too easy to do just int, also try to support float or even complex.
Develop this calculator using Test-driven development - write all the tests before you do a single line on the actual calculator.
Use the following test template
|
|
Then, if you save the above as tests.py you can run the tests using
|
|
or with pytest as
|
|
If you want to use advanced pytest features, you can read more about them here. For testing of numpy arrays I recommend using the built in test support. To read more about what kind of assert helper unittest provides, see the TestCase docs. A particularly useful helper is for testing that functions fail as expected using e.g. assertRaises as in
|
|
- Reflection afterwards
- Did you anticipate all the aspects you needed to test? What was missing? Where there useless
- tests? Why? Would it have been easier or harder to start without tests?