© Iuliana Cosmina 2022
I. CosminaJava 17 for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-7080-6_9

9. Debugging, Testing, and Documenting

Iuliana Cosmina1  
(1)
Edinburgh, UK
 

Development work does not only require you to 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 and printing them in the console in specific situations.

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

Get Java 17 for Absolute Beginners: Learn the Fundamentals of Java Programming 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.