Agile Engineering Practices

99 flashcards by MentisLibrary

The technical side of agile delivery: XP practices, test-driven development and the test pyramid, continuous integration and delivery, trunk-based development, code review, refactoring and technical debt, and the DORA metrics.

What are the engineering practices of Extreme Programming?
A mutually reinforcing set including test-first programming, continuous integration, pair programming, incremental design, small releases, collective ownership, a ten-minute build and sustainable pace. Kent Beck described them in "Extreme Programming Explained" in 1999.
Why are XP practices described as mutually reinforcing?
Each practice covers the weakness another creates. Continuous integration is safe because of tests, refactoring is safe because of tests, simple design is affordable because refactoring is cheap, and pairing spreads the knowledge all of it depends on.
What are the five values of Extreme Programming?
Communication, simplicity, feedback, courage and respect. Respect was added in the second edition of the book.
What is pair programming?
Two people working at one workstation on one task, with one driving and one navigating, swapping frequently. It is a continuous design conversation and a continuous review at the same time.
What is ensemble or mob programming?
The whole team works on one item at one workstation, rotating the keyboard on a timer. Woody Zuill popularized the practice under the name mob programming.
What does collective code ownership mean?
Any team member may change any part of the codebase, with tests and review as the safety net, rather than each area belonging to one person who must approve or perform every change.
What is sustainable pace?
Working at a rate the team can maintain indefinitely, on the grounds that tired people produce defects that cost more than the hours saved. XP originally framed it as a forty-hour week.
What is a spike in XP?
A short, time-boxed experiment written purely to answer a technical question, with the resulting code expected to be thrown away.
What is the red-green-refactor cycle?
Write a failing test that expresses the desired behaviour, write the simplest code that makes it pass, then improve the design with the test still passing. Repeat in small steps.
Why must a new test be seen to fail first?
Because a test that has never failed proves nothing. Watching it fail confirms it exercises the intended behaviour and that the assertion can actually detect its absence.
What does test-driven development actually improve?
Design as much as correctness. Writing the test first forces the code to be callable in isolation, which pushes dependencies to the edges and keeps units small.
What is the test pyramid?
A guide to test proportions: many fast unit tests, fewer service or integration tests, and few end-to-end tests. Mike Cohn introduced it in "Succeeding with Agile".
What is the test ice cream cone?
The anti-pattern where the pyramid is inverted: a large layer of slow end-to-end and manual tests sits on top of very few unit tests.
Name the kinds of test double.
Dummy objects are passed but never used, fakes have a working but simplified implementation, stubs return canned answers, spies record how they were called, and mocks assert on the calls they expect. Gerard Meszaros defined this taxonomy.
When should you avoid mocking?
When you are mocking types you do not own, or mocking so heavily that the test only proves the code calls the functions the test told it to expect.
What is behaviour-driven development?
An approach that writes examples of desired behaviour in a structured given, when, then form shared between engineers and business stakeholders. Dan North introduced the term and its vocabulary.
What is property-based testing?
Instead of listing examples, you state a property that must hold for all inputs and let the framework generate many cases, shrinking any failure to a minimal reproducer.
What is mutation testing?
A technique that deliberately introduces small changes into the code and checks whether the test suite fails. Surviving mutants mark code that is executed but not actually verified.
What is contract testing?
Testing the agreement between a consumer and a provider separately, so each side verifies it against a shared contract rather than requiring both to be deployed together.
Why are flaky tests so damaging?
A test that fails intermittently teaches the team to rerun rather than investigate, and once rerunning is normal, real failures are ignored too.
How should a team handle a flaky test?
Quarantine it out of the blocking suite immediately so the build stays trustworthy, raise it as work with an owner, and fix or delete it within a short deadline.
Why is code coverage a poor target?
Coverage measures which lines executed, not whether anything was asserted. Once it becomes a target, it is easy to raise by writing tests that call code without checking the result.
What is a characterization test?
A test written to capture the current behaviour of existing code that has no tests, so it can be changed safely. Michael Feathers described the technique in "Working Effectively with Legacy Code".
What is continuous integration, in its original meaning?
Every developer integrates their work into the shared mainline at least daily, and each integration is verified by an automated build and test run. It is a practice, not a server.
What is the rule about a broken build?
Fixing it is the team's top priority, ahead of new work. Nobody builds on top of a red mainline, and if it cannot be fixed quickly the offending change is reverted.
What is the ten-minute build?
An XP practice of keeping the commit-stage build and test run under about ten minutes, because feedback slower than that stops being acted on immediately.
What is a deployment pipeline?
An automated path from commit to production made of successive stages, where the fastest and cheapest checks run first and each stage that passes increases confidence in the same artifact.
Why must you build the artifact once and promote it?
Because rebuilding for each environment can produce a different result from different dependency versions or settings, so the thing tested is not the thing released.
Continuous delivery vs continuous deployment
Continuous delivery means every change that passes the pipeline is releasable, with the decision to release remaining a human one. Continuous deployment means every passing change goes to production automatically.
What is a blue-green deployment?
Two production environments run side by side. The new version is deployed to the idle one, verified, then traffic is switched over, with the previous environment kept ready for immediate rollback.