Programming Methodologies
Software development methodologies are a collection of procedures, techniques, principles and tools that help developers to build computer systems.
Traditional Methodologies
The main traditional approaches are:
- Monumental
- Waterfall
These methodologies are very rigid:
- First complete a functional specification.
- Then the software is developed in several distinct, waterfall-like phases.
This has the following issues:
- Difficult to adapt to changing customer requirements.
- Design errors are:
- Hard to detect.
- Expensive to correct.
For more notes on the waterfall model see the link.
Agile Methodologies
Agility in software development means:
- Adaptability
- Ability to respond quickly to change in the environment.
- Eliminate surprises from changed requirements.
- Risk Reduction
- Less chance of validation errors.
Emphasises an iterative process:
- Build some well-defined set of features.
- Repeat with another set of features.
Value customer feedback:
- Quick feedback.
- Sometimes with a client on-site.
Code-centric:
- Recognise the value in documentation and modelling.
- Realise that it is not as important ast the software itself.
We can do this my developing self-documenting code with; long meaningful names, comments and todo notes.
Testing in Agile
The only way to validate software is through testing. Testing can be:
- Functional - Specific yes or no tests based on the functional specification.
- Non-functional - Stress testing, usability and security testing.
SCRUM
This is an agile approach where:
- Each iteration of software development called a sprint.
- Each sprint delivers working code or a partial product.
- Each phase requires a set of tests.
- Testing is integrated.
There are a few phases:
- Specification
- Development which can be:
- Specification
- Design
- Coding
- Each iteration tests:
- New functions
- All old functions for regression.
- Testing is extensive bu shouldn’t be burdensome:
- Automated testing is ideal.
Test Driven Development
This is putting testing first on the development process:
- Before implementing a piece of code, such as a Java method, start by writing down a test which this method should pass.
- The test is like a goal.
- First state a goal, the do the steps to acheive that goal.
Goals can be:
- Small
- Intermediate
- Final
Tests should be written first so that it is based wholly on the specification and no assumptions are made.
eXtreme Programming
This method has the following essential practices:
- Testing
- How will you know if feature works if you don’t test.
- How do you know if a feature still works after you refactor.
- Should be automated.
- Everything that can break must have a test.
- Continuous Integration
- Means building and testing a complete copy of the system several times per day.
- This can take a significant amount of time if left until the end of the project.
- Refactoring
- This is a technique for restructuring the internal structure of the code without changing its external behaviour but adding new features.
- Enables developers to add features while keeping the code simple.
- Each refactoring transformation does little so less is likely to go wrong.
- Relies on testing to ensure you don’t break anything.
- Planning Game
- Discussing the scope of the current iteration and priority of features.
- 40-hour Work Week
- Small Releases
- Simple Design
- Pair Programming
- A driver writes the code and an observer reviews the code.
- Collective Ownership
- No crucial dependence on one developer.
- On-Site Customer
- Metaphor
- A common language for developers and customers.
- Coding Standards
- Everyone writes code in the same standard to keep it clean and help legibility.
Common Principles
KISS:
- Keep it simple stupid!
YAGNI:
- You ain’t’ gonna need it
- So don’t:
- Add functions not in the specification.
- Add too much future proofing.
These principles may discourage code flexibility and re-use.
Issues of Agile Methodologies
One issue with allowing the requirements to change is that:
- It is hard to develop a schedule.