liveBook · Manning

Test

As explained in The Art of Code

A test is an executable evaluation that checks software behavior against expected outcomes.

Testing is executable or manual verification that checks software behavior against expected outcomes. Its central discipline is doubt: deliberately looking for evidence that code is wrong rather than confirming what already seems correct. Strong testing supports durable software by exposing defects before users discover them. section 9.3 section 7.1.3

Choose test types according to the behavior and boundary being verified:

  • Unit tests verify the smallest pieces of code, such as methods and functions, in isolation; they are automated and commonly run locally or in CI/CD pipelines. section 9.3
  • Integration tests validate interactions between modules or services. section 9.3
  • Functional tests exercise complete business scenarios from a user's point of view. section 9.3
  • Acceptance tests verify that delivered features meet client requirements. section 9.3

Testing a weight converter

A WeightConverter converts pounds to kilograms and rejects negative input. Focused unit tests check a normal conversion, zero, and the expected IllegalArgumentException for a negative value. The test names describe the action and expected result, making the behavior readable while checking both valid and invalid paths. section 9.3

Table 9.3 Main types of tests
Type of test
Purpose / Description
Common Frameworks / Tools
Unit tests
Verify the smallest pieces of code (methods and functions) in isolation. They are fully automated, run locally, and in CI/CD pipelines.
Java: JUnit, TestNG Python: PyTest, unittest JavaScript: Jest, Mocha, Jasmine C#:/.NET: xUnit, NUnit, MSTest
Integration tests
Validate how modules or services interact. They are mostly automated, run locally, and in CI/CD pipelines.
Java: Spring Test, Arquillian Python: PyTest + fixtures JavaScript: SuperTest, Cypress .NET: MSTest, SpecFlow
Functional tests
Test complete business scenarios from a user’s point of view. They are manual or automated.
Selenium, Cypress, Playwright, Robot Framework
Acceptance tests
Verify that newly delivered features meet client requirements. They are manual or automated.
Multilanguage: Cucumber (Gherkin) Python: Behave NET: Reqnroll
Regression tests
Essential tests run after changes to ensure nothing broke. They can be automated or manual and typically replay key unit, integration, acceptance, and functional tests to confirm stability after updates.
Uses the same tools as unit, integration, acceptance, and functional tests.
Performance tests
Performance tests measure speed, response time, scalability, and resource usage using load, stress, or endurance testing. They are usually fully automated but not included in the regular CI/CD pipeline.
JMeter, Gatling, Locust, k6, Artillery
Security tests
Detect vulnerabilities such as injections, XSS, or weak authentication. Automated through static code analysis tools, such as SonarQube, and dynamic testing tools, often complemented by manual penetration testing.
OWASP ZAP, Burp Suite, Snyk, Bandit
Chaos engineering/resilience testing
Intentionally inject failures or adverse conditions to verify that the system remains stable and recovers as expected under real-world turbulence. Manual or automated, but used selectively in staging or carefully controlled production environments.
Chaos Mesh, LitmusChaos
Accessibility tests
Ensure compliance with accessibility standards. Automated and manual tools detect violations, and testers confirm usability.
Axe, Lighthouse, Pa11y, Deque tools
Exploratory tests
Manual tests. Discover UX flaws or unexpected behavior. Rely on tester observation and creative exploration.

Compare test types by purpose, scope, automation, execution context, and representative frameworks. section 9.3

How The Art of Code covers it

How deep it goes
Defines testing's rationale and categories, then demonstrates unit-test cases; it does not detail comprehensive test planning.
Examples
Uses a WeightConverter with valid, zero, and negative-input unit tests, alongside a taxonomy of test types and tools.
What you can do after
Apply it via JUnit unit tests to verify normal results, boundary values, and expected exceptions.
How it connects
Connects testing with durability, confirmation bias, debugging, exception handling, refactoring risk, and CI/CD.

Also explained in

Compare how 53 books explain test →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.