Software Engineering vocabulary · Testing

Assertion

Meaning in software engineering, with examples

/əˈsɜːrʃn/nounCommon term

In software engineering, assertion means: A line in a test that checks whether a result matches the expected value. If the check is false, the test fails.

In Turkish: doğrulama ifadesi, beklenti kontrolü, assertion

How it is used

Written with functions such as assertEquals, expect(...).toBe(...) or Python's assert. Reviewers ask for 'a stronger assertion' when a test checks too little. 'Assertion failed' or 'AssertionError' in the output tells you which check broke.

Example sentences

  1. This test has no assertions, so it passes even when the function returns garbage.

  2. Add an assertion for the error message, not just for the status code.

Common collocations

  • add an assertion
  • the assertion fails
  • assertion error
  • a stronger assertion

More terms: Testing

Practise with graded reading

Reading at the right level is the fastest way to make new words stick. Pick free English books by level: