Skip to content

Ovect Technologies

  • CaseStudies
  • ArtificialIntelligence
  • DataScience
  • Software
  • Contact Us
  • About Us
Ovect Technologies

Ovect Technologies

Software, Data Science, Analytics, Machine Learning and Artificial Intelligence

Software Testing Part 1: Motivation

April 30, 2021 by SP Ng

Tags: Testing

Why is software testing important? For a variety of reasons, we sometimes need to change/extend/improve code. Take for instance we have a function func() which might look like
func(a, b) := 0.5 * a + 0.5 * b
Say we want to change this to
func(a, b) := (a + b)/2
As we have changed the implementation of func(), we need to check that every thing still works fine. To do it manually is laborious and for huge projects, where it is needed most, manual checking is very time consuming and error prone.

What can we do? This is where automated testing frameworks such as pytest really shines.  We can set up a test for the above function. Of course we want to make sure it covers every case we can think of. In pseudo-code, it could look like
def func_test():
inputs = [[3, 5], [2, -4], [-3, -2]]
expected_outputs = [4, -1, -2.5]
for i in range(len(inputs)):
assert func(inputs[i,0], inputs[i,1]) == expected_outputs[i]

We have three sets of inputs and outputs above. But you can imagine a hundred sets of inputs and outputs covering every conceivable case you can think of.

All you need to do is launch the tests and if anything is off, it will be immediately flagged. The developer can then go fix this.

Furthermore, you can chain a couple of small tests together and test a larger set of components. Then chaining the large components together, you can test the whole system. All by launching the automated tests via a single clock.

This is standard best practice for software that works in any mission-critical environment. Here at OVECT, we use continuous automated testing for all our products so that our codebase is long-term maintainable.

Post navigation

Next Post:

Youtube: Kate Gregory’s CppCon 2017 talk on 10 Core Guidelines You Need to Start Using Now

Search

Recent Posts

  • Youtube: Python as C++’s Limiting Case by Brandon Rhodes
  • Youtube: Death of Devops by Graham Zabel
  • Sales Data and Targeted Marketing
  • Online Marketing: Using Reinforcement Learning for AB Testing
  • Youtube: Kate Gregory’s CppCon 2017 talk on 10 Core Guidelines You Need to Start Using Now
© 2025 Ovect Technologies