Skip to main content

What to Test?

When you are inside the code for an application, often this question doesn't get pondered.

It seems like an obvious question, "What to test?" "Duh, everything!" or "What I just implemented." 

But really, testing everything is often out of the question for a reasonably complex application, The permutations of states and settings grows quickly. If you have 4 settings which can each be one of two values, that's 16 (2 x 2 x 2 x 2) different combinations to be tested. Add another setting of only 2 choices and you have 32 combinations. If each setting is one of three values, there are 81 (3 x 3 x 3 x 3) combinations.  I think you can see the problem. If you have a good unit testing framework that will let you automate generation of numerous test cases, that can help a lot. But you still need to consider the question and the answer and decide if you are testing the right parts of the application , whether it's unit tests, manual tests, system tests, whatever.

There are a number of different approaches you can think through to analyze your testing, which can help answer the question of what to test and put together a plan for effective testing. The first idea is to think about where risks are. Often this is in the newest code, the most complicated or the areas with the most demanding performance requirements.  Look for long routines and count the conditional statements if you want to make it a quantitative analysis. 

Looking at the interfaces is a different angle for analysis. Not just application programming interfaces, but also network communications, shared memory, library calls, database queries and data acquisition are all types of interfaces. Interfaces are often the areas where there are more edge cases to test and where there is more chance for input values to wrong. 

Often using probabilities can help focus testing efforts. What are the most likely code paths? Here you can make use of logging and historical information from your software.  Looking at your application from the outside-in or top-down plays well in terms of looking at features for testing.

There's always something to test. Of course, these analyses can also help inform your decisions on what not to test as well. This is equally important, as you want to avoid diminis hinges returns on your testing efforts. 

Good ideas on what to do instead of test is here: https://users.ece.cmu.edu/~koopman/des_s99/sw_testing/#alternative

Comments

Popular posts from this blog

Unit Testing - What to Test

This I wrote to answer a question that came up when we were discussing our software process and I was training developers on how to unit test. It seems a simple enough question, but I kept pondering it and delving deeper until I realized I needed to write this monograph. What unit tests should we write? How do we know what to test? Ideally, unit tests should cover every path through the code. It should be your chance to see every path through your code works as expected and as needed. If you are practicing Test Driven Development then it's implied everything gets a test. In the real world, you might not be allowed to test everything - for instance, if the testing suite ends up taking a week to run, then the world will have changed by the time it finishes and the test results will be obsolete. Unit testing at it's basic is testing an object, a method - the smallest unit of your code that it can test independently. It should test the inputs "goes into" an...

Risk Mitigations for Custom Applications

  In many healthcare applications, often due to the cloistered nature of the use cases – e.g. it will only be accessed by users authorized in a particular facility, such as an operating room suite – the needs for Authentication and Authorization are minimized when the system is designed and implemented. This presents a risk as soon as you allow for the possibility of users with ill-intent or that otherwise want to operate outside their given roles. Custom applications need to consider these possibilities and implement the following measure to ensure the integrity of the system. 1.   Authentication and Authorization Controls: Multi-Factor Authentication (MFA): Implement MFA for all user logins. This adds an extra layer of security beyond just a username and password. Role-Based Access Control (RBAC): Grant users access only to the data and functionalities they need for their specific role. This minimizes the potential for unauthorized access. Strong Password Policies: ...

You don't really know who you're talking to online...

The following is a story that I think highlights the assumptions that get you into trouble online... https://www.proofpoint.com/us/blog/threat-insight/i-knew-you-were-trouble-ta456-targets-defense-contractor-alluring-social-media This is particularly scary since we found so much utility in online connections during the pandemic and out of necessity, started trusting more online. Please note the timeline for this breach - it was a long, slow process, a key factor in many 'cons'. "Build trust" is a key first step, once someone has identified you as a party. You think...you're convinced you know who your talking to, but if you don't triangulate the identity with some non-online, ideally in-person information, you shouldn't trust. And even if you do get what seems like real-life confirmations of identity, you must look at questioning motives, needs, and keeping danger at arms-length. Online includes email, texting (sms), application chatbots, voice communicati...