๐Ÿงช
๐Ÿ“ Testing & Quality ยท TEST-101 ยท Assignments

Testing & Quality โ€” Assignments

Work each problem yourself first, then open the worked solution to check your thinking. This is where the course sticks.

๐Ÿ“ 5 problemsโœ๏ธ Worked solutions
Problem 1

Explain the real benefit of testing beyond 'catching bugs today'.

Show worked solution

A strong answer captures that testing's biggest payoff is confidence to change code without fear - enabling refactoring and growth - so tested code can evolve safely while untested code rots because it's too risky to touch.

Problem 2

Write a small test using Arrange-Act-Assert (or unittest) for a function.

Show worked solution

Good answers set up inputs (arrange), call the function (act), and assert the expected result, using a bare assert or unittest's assertEqual/assertRaises, with a clear focused test and sensible name.

Problem 3

For a function of your choice, list what you would and wouldn't test, including edge cases.

Show worked solution

Strong answers target the real logic and skip trivial code, and enumerate meaningful edge cases (empty, zero, negatives, first/last, invalid input) - showing testing is judgement, not testing everything.

Problem 4

Explain the red-green-refactor cycle of TDD and one benefit of writing the test first.

Show worked solution

Good answers describe writing a failing test (red), the simplest code to pass it (green), then cleaning up (refactor), and a benefit like forcing you to define 'done' first, or guaranteeing testable, well-covered code.

Problem 5

Name two quality practices beyond tests and what each catches.

Show worked solution

Strong answers pick from readability (maintainable code for the next human), code review (design flaws / unclear code / missed cases), linting (style + likely mistakes), and measuring performance (the real bottleneck), explaining what each addresses.

More in this course

Course home → · Browse all courses →