Reader small image

You're reading from  How to Test a Time Machine

Product typeBook
Published inMar 2023
Reading LevelN/a
PublisherPackt
ISBN-139781801817028
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Noemí Ferrera
Noemí Ferrera
author image
Noemí Ferrera

Noemí Ferrera is a self-taught programmer and wrote her first comprehensive program at the age of nine. When she grew up, she proceeded to achieve a degree in computer science specializing in hardware in Spain, a bachelor's degree in software engineering in Ireland, and a master's degree in computer science in Spain. She is an international speaker and participates in testing community conferences (such as Selenium, Appium, and Automation guilds) and engages with the community through Slack channels, Twitter, and her blog. In the 2020 Test Guilds publication, she was named as one of the top 28 test engineers to follow, as well as one of the top 33 test automation leaders to follow in the 2019 Tech Beacon and as one of the 100 women in tech to follow and learn from by agiletestindays in 2023.
Read more about Noemí Ferrera

Right arrow

Mathematics and Algorithms in Testing

In the previous chapters, we learned about different types of testing across the test pyramid. In Chapter 5, Testing Automation Patterns, we deepened our knowledge of UI/E2E testing, which, for better or for worse, tends to end up being the biggest focus for many applications. In the previous chapter, we talked about continuous testing and other DevOps concepts that we should know about to make sure that the quality stands across the development and deployment aspects.

Before we look at more challenging topics, we need to take a little break and look at some mathematical foundations and concepts. In this chapter, we will look at the mathematics that can help you with your tests.

Mathematics is sometimes overlooked in computer science, especially in the testing area. However, having knowledge of and, arguably, love for mathematics would put you forward in your career and improve the quality of the tools that you create Every computer science...

Technical requirements

Some degree of programming skill is recommended to get the most out of the examples provided. In this chapter, we will use a variety of programming languages, mainly C#, Python, and JavaScript.

We recommend reviewing and working with different languages as a self-growth exercise. We have provided an implementation for other languages in this book’s GitHub repository: https://github.com/PacktPublishing/How-to-Test-a-Time-Machine/tree/main/Chapter07.

While this chapter was written with the QA/SDET role in mind, as applications shift left, developers may find this one interesting. Furthermore, if you are trying to get developers more involved in testing, this is the chapter you will want to show to them as it will hopefully trigger their “building” instincts and curiosity.

Algorithms, mathematics, and testing

In this section, we will learn how and why mathematical algorithms can help with the quality of applications and their testing.

Mathematics is all around us and as it happens with many things, once you start gaining interest in it, you will see it everywhere: in the shape of plants and fruits whose leaves grow following mathematical series to find the highest amount of sunlight, in music and harmony, in the stars, in atoms, and more.

As we mentioned in the introduction, it is perfectly possible to solve programming challenges without the explicit use of mathematics. Note the word explicit here; we implicitly use mathematics in algorithms to calculate the size of data structures, perform complex calculations, etc.

However, understanding the mathematical approach could help you improve algorithms and code complexity and reduce the use of resources and data structures. This could give you an advantage while reviewing someone else’s...

Understanding the role of data science in testing

The data science field uses scientific mathematical methods to understand relationships and extract knowledge from data so that we can use this knowledge to our benefit. This, of course, applies to testing. Therefore, mathematics gives us methods that we can use to find relationships between the different data of our system and value performance and other metrics.

In the previous chapter, we discussed how important it is to use metrics and log the right information in our system. Most of this information comes in one way or another from testing. However, even though it is important to extract this information, being able to make sense of it is just as important. This way, we can improve the system and provide better-quality applications to the users.

Your company may have a specialized data scientist that could help you achieve this purpose, but I believe that this is a field you should strive to understand and be comfortable...

Reviewing some techniques for test case analysis

If you were to ask different experts to categorize test cases by their priority, you would likely come across very different opinions. This task is not trivial, as having the right categorization could help us identify which test cases to automate first, or which ones to execute on our build verification tests (BVTs) so that we could promptly find the maximum number of issues and identify the most important tests cases that would cover them.

Most of the audience members I have asked throughout several conferences affirm to have more than 100 and even up to 500 test cases to explore per deployment or to automate. Handling so many test cases per deployment is currently achievable thanks to cloud parallel testing platforms (more on that will be covered in Chapter 9, Having Your Head up in the Clouds). However, these tools might charge us money per run or per the number of tests executed, and we must ensure those tests are bringing value...

The early approach to AI – it’s all thanks to mathematics

Artificial intelligence is, at its core, a set of mathematical functions and algorithms that help us achieve a purpose. Different purposes require different algorithms. Therefore, if you want to learn and/or use artificial intelligence to help you engage the quality of your system, it would be convenient for you to learn to love mathematics and learn some core mathematical concepts.

Lucky for us, some experts dedicate themselves to perfecting these algorithms so that we can use some predefined functions rather than having to write them on our own. However, as we discussed at the beginning of this chapter, if you know what the functions do, you will understand what to look for and which one of them to use.

There are different sets of definitions for AI. My favorite one is that of Luger and Stubblefield in 1993:

Artificial intelligence

[AI is the] branch of computer science that is concerned...

Summary

We are more than halfway through this book – well done on getting here! If you are reading this, chances are you are enjoying this book. If that is the case, please consider telling others about it. Feedback is also very much welcome (so long as it is gentle; I am a kind and sensitive soul).

I hope this chapter has made you curious about mathematics and makes you want to keep an open eye for it everywhere and an open mind for it as well, enjoying the little magic inherent to it. In this chapter, we looked at several algorithms and concepts that can help you grow your mathematical skills. We also saw how to put some of them into practice with exploratory testing (creating a web crawler), showing our data by creating dashboards, and our first approach to artificial intelligence with the test cases analyzer.

So far, we have seen concepts that could be applied to most applications. However, they cannot be applied to all applications equally or straightforwardly. In...

Further reading

For more information about the topics that were covered in this chapter, take a look at the following resources:

Make sure you review courses on artificial intelligence, fuzzy logic, algorithms, and all the items mentioned at the beginning of this chapter. A couple of resources from our library that might be interesting to follow up...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
How to Test a Time Machine
Published in: Mar 2023Publisher: PacktISBN-13: 9781801817028
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Noemí Ferrera

Noemí Ferrera is a self-taught programmer and wrote her first comprehensive program at the age of nine. When she grew up, she proceeded to achieve a degree in computer science specializing in hardware in Spain, a bachelor's degree in software engineering in Ireland, and a master's degree in computer science in Spain. She is an international speaker and participates in testing community conferences (such as Selenium, Appium, and Automation guilds) and engages with the community through Slack channels, Twitter, and her blog. In the 2020 Test Guilds publication, she was named as one of the top 28 test engineers to follow, as well as one of the top 33 test automation leaders to follow in the 2019 Tech Beacon and as one of the 100 women in tech to follow and learn from by agiletestindays in 2023.
Read more about Noemí Ferrera