Book Image

Node.js High Performance

By : Diogo Resende
Book Image

Node.js High Performance

By: Diogo Resende

Overview of this book

Table of Contents (14 chapters)

Test fundamentals


Tests can be defined in a variety of ways. The most common approach is unit testing. This is a method by which parts of your application are individually checked to confirm that they comply with the specifications. This approach encourages your application parts to act as independent and replaceable black boxes.

You need real data to properly test your application. You also need unrealistic data. Both are crucial to confirm that it behaves as expected with both correct data and scrambled data. This ensures that a misguided or malicious user won't break your application.

You might be wondering what I mean by unrealistic data. Does your application handle text in date fields or numbers in checkboxes? What about missing data? You might think it does, but if you have more developers working on it, you may want to ensure that, somewhere in the future, it doesn't stop behaving correctly. The most common type of bug occurs in one place after making a change in a completely different...