# Deduction vs Induction

## Deduction

Deductive logic takes a hypothesis to serve as a premise to be tested by looking for evidence that falsifies it. The logical conclusion reveals whether the hypothesis is still valid and sound, or needs to be revisited. Due to this, it is also known as “top-down” logic. It’s the only approach for natural, positivist science and typically uses quantitative approaches (Robson, 2011). Examples:

• All swans are white (major premise), this is a swan (minor premise) therefore it is white (logical conclusion)

In testing, this starts with an initial claim of quality (such as a user story or design) and then tests the software to find evidence to falsify the initial claim. Stories of benefit and risk can be hypothesised and tested for evidence that falsifies and supports a counter-claim of quality respectively. These form the premises. A logical conclusion is then formed whether the initial claim or hypothesis is still sound or whether a serious threat to value exists.

## Induction

Inductive logic is more open-ended. Start with little or no premise and look for evidence first. A hypothesis is then formed from the logical conclusion that explains all of the evidence. Due to this, it’s also known as “bottom-up” logic. It’s the typical approach used by relativist science and typically uses qualitative approaches (Robson, 2011). Examples:

• This swan is white (premise), all these other swans are white (premise), therefore all swans are white (logical conclusion)

In testing, this starts without any hypotheses of benefit and risk, or even any initial claims of quality (such as user stories). This means specifications aren’t required for testing so long as as there’s software to test (the opposite is also true). Instead, testing begins and various observations are made that can be compared against other expectations. These forms the premises. From these observations and expectations, stories of quality can be expanded and hypothesised where they represent a serious threat to value. This forms the logical conclusion.

## Abduction

Abductive logic is a third type of logic but less precise, and therefore less scientific (but not any less valid or sound), but is suited to software testing when making a best argument for threatened value in a bug report or speculating on the cause of a bug. Similar to induction, abductive reasoning is taking multiple pieces of evidence and forming a most likely conclusion based on them. Examples:

• There are large white feathers on the ground (observation), there are swans nearby (observation), therefore they probably are swan feathers (most likely conclusion).

In testing, there is a bug in this feature (observation), there is a similar bug in this feature (observation), therefore the shared underlying code between them most likely has an error (most likely conclusion).

As with science, this important deduction and induction dichotomy is represented as two sides to software quality testing that takes the form of questions:  “does the software behave as intended under the conditions that it’s supposed to be able to handle?” (requiring a “checking” approach) and “are there any other risks?” (requiring an “exploring” approach) (Hendrickson, 2003). The first question and approach corresponds to the deductive approach as a tester starts with a premise and then looks for the evidence to falsify (or support) it. The second question and approach corresponds to the inductive approach as a tester starts without a premise and instead looks for the evidence to form one.

The inductive and abductive is why the majority of testing is to uncover new information and build hypotheses, not to confirm/disconfirm existing claims and hypotheses, and therefore has strong roots in grounded theory (so called because the theory is “grounded” in reality) (Edgren, 2011).

# Logical Loops

However rather than being two separate activities, both types of logic are linked together where they feed off and into each other to form a single continuous loop.

In science, there is a constant interplay between inductive inference (based on observations) and deductive inference (based on theory), until we get closer and closer to the ‘truth,’ which we can only approach but not ascertain with complete certainty

(Wassertheil-Smoller, 2017)
 Inductive exploring to uncover and build… Deductive checking to falsify and refute…

Deductive testing is checking to confirm or disconfirm. It takes stories of quality (hypothesis premise) and performs experiments and observations (premises) in an attempt to falsify (or support) them (conclusion). Should falsification occur, then the benefit or risk is revisited or reformed feeding into inductive testing.

Inductive testing is exploratory to uncover and construct. Experiments are performed and observations are made to learn and understand the software (premises) in an attempt to form stories of quality (hypothesis conclusion). Once a story has been written, testers look for evidence that falsifies it via deductive testing methods and thus completing the loop.

An example of this loop at work in software quality and testing is the “information model” by Dan Ashby. Information on quality is at the heart of the loop which feeds into hypothesis of quality in the form of stories. Investigative, exploratory testing that uncovers new information corresponds to the inductive approach and assertive, scripted testing that confirms (or falsifies) existing information corresponds to deductive approach. The latter also makes use of test case execution, including test automation (Ashby, 2021).

It’s worth noting that it’s possible to perform one type of testing without the other, however both approaches are important for complete testing. A skilled tester will constantly use both inductive, exploring testing (hypothesis uncovering/building) and deductive, assertive/checking testing (hypothesis falsifying) approaches when researching and reporting on the quality of software (Bach and Bolton, 2013) (Hendrickson 2013).

This means test cases or test automation alone won’t give a good assessment of quality. In fact, these checks are a type of quantitative measurement (which the deductive approach favours) where the result is a binary pass or fail (one or zero) that may add up to a number of passed or failed tests. However a business stakeholder may ask “is the product good enough? Is it actually going to solve our customer’s problem?”. Responding with “198/198 tests passed” by itself probably isn’t going to cut it requiring stories of who, what, where, when, why and how of quality will be expected.

# Truth Helix

Testing isn’t just one set of loops however:

Rather than viewing these two processes in a circular relationship, perhaps they can be better viewed as a helix, with each iteration between theory and data contributing to better explanations of the phenomenon of interest and better theories.

(Bhattacherjee, 2012)

The loop exists as before, a constant interplay between inductive and deductive testing. However each iteration builds upon the last. The idea is, the more the tester applies both approaches, the higher they climb the helix and the closer they approach the truth of quality and the better information they have for stakeholders:

 Truth of quality Inductive exploring (hypothesis uncovering / building) Deductive checking (hypothesis falsifying / refuting)

Next:

• Method - Testing scientific model and process of research question, background investigation, analysis, hypothesis, experiment, evaluation, action (reporting)

# Citations

• Ashby, D., 2021. Continuous Testing Throughout the SDLC. [online] Ministry of Testing. Available at: Link
• Bach, J. and Bolton, M., 2013. Testing and Checking Refined. [online] Satisfice. Available at: Link
• Bhattacherjee, A., 2012. Science and Scientific Research. Social Science Research: Principles, Method and Practices, 2nd Edition. Tampa: University of South Florida. p. 4
• Edgren, R., 2011. The Little Black Book on Test Design. [online] thoughts from the test eye. Available at: Link p. 4
• Hendrickson, E., 2013. Explore it! Reduce Risk and Increase Confidence with Exploratory Testing. Frisco, TX: The Pragmatic Programmers, pp. 4-6.
• Robson, C., 2011. Real World Research. 3rd ed. Oxford: Wiley, pp. 18-19.
• Tomes, S., 2019. Start Exploratory Testing Today – Risks & Questions. [online] TestBuddy. Available at: Link ti. 03:05
• Wassertheil-Smoller, S. (2017). Deductive Reasoning vs. Inductive Reasoning. [online] LiveScience. Available at: Link

2022-07-06: Minor revisions and updates