© Iuliana Cosmina 2018
Iuliana CosminaJava for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-3778-6_9

9. Debugging, Testing, and Documenting

Iuliana Cosmina1 
(1)
Edinburgh, UK
 

Development work does not only require you to write design the solution for a problem and write the code for it. To make sure your solution solves the problem, you have to test it. Testing involves making sure every component making up your solution behaves as expected in expected and unexpected situations.

The most practical way to test code is to inspect values of intermediary variables by logging them; print them in the console only in specific situations.

When a solution is complex, debugging provides the opportunity to pause the execution and inspect state of the ...

Get Java for Absolute Beginners: Learn to Program the Fundamentals the Java 9+ Way now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.