Skip to content

TechWithMahdi.com

Master IT Skills with Expert Tutorials and Real-World Guides

  • Home
  • About
  • Contact
Leave a Comment on Conclusion

Conclusion

Unit tests are a great way to have a clear and reliable code base. Good unit tests gives you the […]

Leave a Comment on Learn your testing framework

Learn your testing framework

Testing frameworks can offer a lot in terms of features, assertions and utility functions. It is always better to learn […]

Leave a Comment on Test edge cases

Test edge cases

Edge cases can be defined as a subset of tests that check extreme limits of valid input values. Testing edge […]

Leave a Comment on Avoid magic values

Avoid magic values

Like in production code, the way you are using and naming variables in unit tests is important. A magic value […]

Leave a Comment on Cover the maximum you can

Cover the maximum you can

Coverage is the measurement of how much production code is covered by unit tests. The most common types of code […]

Leave a Comment on Validate private methods using public methods

Validate private methods using public methods

While is it possible to test private methods individually, it is good a practice to “cover” them by testing only […]

Leave a Comment on Avoid logic in unit tests

Avoid logic in unit tests

When you write unit tests, you should avoid logical structures such as conditions and loops. Adding unnecessary logic to your […]

Leave a Comment on Write fast unit tests

Write fast unit tests

As mentioned before, fastness is one of the characteristics of a good unit test. Try to make your unit tests […]

Leave a Comment on Write isolated unit tests

Write isolated unit tests

Unit tests should run in complete isolation. When you write a unit test make sure it does not depend on […]

Leave a Comment on Test one thing at a time

Test one thing at a time

The Idea behind unit testing is to verify that each “separate” unit of your software is working as expected. Tests […]

Posts pagination

1 2 3 Next
Popular categories
  • Cybersecurity
  • Miscellaneous
  • Software design
  • Software Quality
Legal
  • GDPR compliance
  • Privacy Policy
  • Terms of service
Social media
  • Facebook
  • LinkedIn
  • X
Copyright © 2024 techwithmahdi.com