Printing is unavailable

This course is licensed for personal online viewing only.

Public preview • CL-P000000-C42-L2119-BBF686AA

Home Dashboard
Chapter 2 · Module 1 — Software Testing Fundamentals

Fundamental Principles of Software Testing

Priority
  • JobHigh
  • InterviewHigh
  • DevelopmentHigh
3,915
words
22
min read
2
tools

1. Learning Outcomes#

इस chapter के बाद आप:

  • Software Testing के सात principles समझ सकेंगे।
  • समझ सकेंगे कि tests pass होने से software defect-free साबित क्यों नहीं होता।
  • सीमित समय में risk के अनुसार test cases चुन सकेंगे।
  • Early Testing, Defect Clustering और Tests Wear Out के उपयोग समझ सकेंगे।
  • अलग-अलग applications के लिए सही testing priorities तय कर सकेंगे।
  • User needs और technical correctness का अंतर पहचान सकेंगे।
  • AI-assisted QA में इन principles को लागू कर सकेंगे।

2. Fundamental Testing Principles की जरूरत#

मान लीजिए आपकी टीम ने एक Online Shopping Application बनाया है। उसमें Login, Product Search, Cart, Payment और Order Confirmation जैसे features हैं। Release के लिए केवल दो दिन बाकी हैं। क्या आप सभी possible inputs, devices और situations test कर पाएँगे?

शायद नहीं। इसलिए अच्छा Tester केवल अधिक tests चलाने की कोशिश नहीं करता। वह समझता है कि किसे, क्यों और कितनी गहराई से test करना है। Testing Principles इसी सोच को दिशा देते हैं।

English Definition#

Key Idea

Software Testing Principles are fundamental guidelines that help testers plan, prioritize, execute, and evaluate testing effectively.

आसान शब्दों में, ये सात ऐसे मार्गदर्शक विचार हैं जो बताते हैं कि Testing के परिणामों का सही अर्थ क्या है और सीमित resources का बेहतर उपयोग कैसे करें। ये Manual Testing और Automation Testing दोनों में लागू होते हैं।

Principle मूल विचार
Testing Shows Presence, Not Absence Defects मिल सकते हैं; पूरी तरह defect-free होने का प्रमाण नहीं मिलता
Exhaustive Testing Is Impossible सभी combinations test करना सामान्यतः संभव नहीं
Early Testing Saves Time and Cost समस्याएँ जल्दी मिलने पर rework कम हो सकता है
Defects Cluster Together कुछ components में अधिक defects मिल सकते हैं
Tests Wear Out पुरानी test suite में सुधार करना पड़ता है
Testing Is Context Dependent Application के risks के अनुसार testing बदलती है
Absence-of-Defects Fallacy User needs पूरी न हों तो passing tests पर्याप्त नहीं

3. Principle 1 — Testing Shows the Presence, Not the Absence, of Defects#

English Definition#

Key Idea

Testing can reveal the presence of defects, but it cannot prove that a software product is completely free of defects.

Login Page का उदाहरण#

मान लीजिए आपने चार tests किए:

Test Case Observed Result
Correct email and password Login successful
Wrong password Error message displayed
Empty email Validation displayed
Empty password Validation displayed

चारों tests pass हुए। क्या अब Login Feature में कोई defect नहीं है?

ऐसा दावा नहीं कर सकते। आपने locked account, expired account, network interruption या कई simultaneous requests जैसी situations शायद test ही नहीं कीं।

Test pass का मतलब है कि उस test के दौरान actual behavior अपेक्षित behavior से मिला। इससे confidence बढ़ता है, लेकिन बाकी सभी situations के बारे में पक्का प्रमाण नहीं मिलता।

Visual Diagram80%

Rendering diagram…

Diagram में test execution के दो परिणाम दिखते हैं। Unexpected behavior मिलने पर investigation शुरू होती है। Test pass होने पर केवल उस tested condition के लिए evidence मिलता है।

Professional Reporting#

Tester को “Application is 100% bug-free” नहीं कहना चाहिए। बेहतर report बताएगी कि कितने tests चले, किन scenarios में failure मिला, और कौन-से risks अभी untested हैं।

Remember

Passing tests provide evidence about tested behavior, not a guarantee of complete correctness.

4. Principle 2 — Exhaustive Testing Is Impossible#

English Definition#

Key Idea

Exhaustive testing means checking every possible combination of inputs and preconditions; this is generally infeasible except for very simple cases.

Combinations इतनी जल्दी क्यों बढ़ते हैं?#

मान लीजिए किसी application में चार fields हैं और हर field के तीन संभावित values हैं। सभी combinations की संख्या होगी:

3 \times 3 \times 3 \times 3 = 81

अब एक और example देखिए:

  • 5 Browsers
  • 3 Operating Systems
  • 4 User Roles
  • 10 Input Combinations

सभी dimensions स्वतंत्र मानें, तो कुल configurations होंगे:

5 \times 3 \times 4 \times 10 = 600

यह केवल configurations की संख्या है। हर configuration में कई workflows और failure conditions हो सकती हैं।

Visual Diagram80%

Rendering diagram…

यह flow दिखाता है कि हर नया dimension कुल possibilities को गुणा कर देता है।

Tester को क्या करना चाहिए?#

इस principle का मतलब कम मेहनत करना या random tests चुनना नहीं है। इसका मतलब है risk-based selection।

Feature Failure impact Example priority
Money Transfer Very high High
Login Authentication High High
Profile Picture Usually low Low
Theme Color Usually low Low

Risk का निर्णय केवल impact से नहीं, बल्कि failure की संभावना और context से भी होता है। High-risk workflows, invalid inputs, important boundaries और known failure conditions को प्राथमिकता दें।

Common Mistake

“सब कुछ test नहीं कर सकते” का अर्थ “कोई भी कुछ tests काफी हैं” नहीं है। Test selection को justify करना चाहिए।

5. Principle 3 — Early Testing Saves Time and Cost#

English Definition#

Key Idea

Testing activities should start as early as possible in the software development lifecycle to discover problems early and reduce potential rework.

Coupon Requirement का उदाहरण#

Business requirement है: “Customer एक order पर केवल एक coupon apply कर सकता है।”

Situation A: Tester requirement review में ही पूछता है कि क्या multiple coupons allowed हैं। Business Team स्पष्ट करती है कि केवल एक coupon allowed है। Developer शुरुआत से सही logic बनाता है।

Situation B: किसी ने सवाल नहीं पूछा। Developer multiple coupons का feature बना देता है। UI, backend और database-related changes पूरे होने के बाद गलती सामने आती है। अब कई हिस्से दोबारा बदलने पड़ सकते हैं।

Visual Diagram80%

Rendering diagram…

यहाँ दोनों रास्तों का अंतर देखिए। Early review समस्या को code बनने से पहले रोक सकती है। Late discovery में अधिक rework का जोखिम रहता है।

Testing क्या Code बनने के बाद ही शुरू होती है?#

नहीं। Requirements और design की review भी testing activities का हिस्सा हो सकती है।

Stage Useful Testing Activity
Requirements Ambiguities और missing conditions पहचानना
Design Inconsistencies और risks की review
Coding Code review और component checks
Integration Components के interactions जाँचना
Release Preparation Product behavior और readiness evaluate करना

हर defect को जल्दी पकड़ने से हमेशा निश्चित amount बचता है, ऐसा दावा नहीं किया जा सकता। फिर भी शुरुआत में problems पहचानना अक्सर बाद का rework कम कर सकता है।

Remember

Testing activities can begin before executable software is available.

6. Principle 4 — Defects Cluster Together#

English Definition#

Key Idea

A relatively small number of software components often contain a large proportion of discovered defects.

मान लीजिए Testing में कुल 50 defects मिले:

Module Defects Found
Payment 20
Checkout 15
Login 7
Product Search 5
User Profile 3
Total 50

Payment और Checkout में कुल 35 defects हैं। इसलिए इन दोनों का योगदान है:

\frac{35}{50}\times100=70\%

यानी इस sample में 70% discovered defects केवल दो modules में मिले।

Figure 1: Example distribution of 50 discovered defects
Example distribution of 50 discovered defectsPaymentPaymentDefects Found — Payment: 20CheckoutCheckoutDefects Found — Checkout: 15LoginLoginDefects Found — Login: 7Product SearchProduct SearchDefects Found — Product Search: 5User ProfileUser ProfileDefects Found — User Profile: 3
View chart data
LabelDefects Found
Payment20
Checkout15
Login7
Product Search5
User Profile3

Chart में Payment और Checkout के bars बड़े हैं। इन्हें अधिक focused testing की आवश्यकता हो सकती है, विशेषकर यदि हाल में code changes हुए हों।

कुछ Modules में ज्यादा Defects क्यों?#

Complex business logic, frequent changes, integrations और unclear requirements इसके संभावित कारण हैं। लेकिन historical defect count अकेले future risk साबित नहीं करता। Severity, impact और changes भी देखें।

उदाहरण के लिए, Checkout में लगातार errors मिले हैं तो उस module में अतिरिक्त test cases उपयोगी हो सकते हैं। फिर भी बाकी critical modules को अनदेखा नहीं करना चाहिए।

Key Idea

Defect history helps prioritize testing, but it never proves that other modules are safe.

7. Principle 5 — Tests Wear Out (Pesticide Paradox)#

English Definition#

Key Idea

Repeating unchanged tests without reviewing and improving them can reduce their effectiveness in detecting new defects.

Login Tests का उदाहरण#

आपके चार पुराने test cases हैं:

  • Correct Credentials
  • Incorrect Password
  • Empty Username
  • Empty Password

नए release में Account Locking, OTP Verification और Password Expiration जोड़ दिए गए। पुराने चार tests अभी भी pass हो रहे हैं। फिर भी नए features में defects हो सकते हैं, क्योंकि पुराने tests उन्हें जाँचते ही नहीं।

इसका अर्थ पुराने tests को delete करना नहीं है। पुराने regression tests उपयोगी रह सकते हैं। उनके साथ नए scenarios और changed behavior के tests जोड़ना जरूरी है।

Visual Diagram80%

Rendering diagram…

Flow में ध्यान दें कि Test Suite का review software changes के साथ होना चाहिए। Existing tests रखे जा सकते हैं और नए tests जोड़े जा सकते हैं।

Pesticide Paradox नाम क्यों?#

इस नाम की analogy बताती है कि एक ही उपाय बार-बार इस्तेमाल करने से नई problems पहचानने में उसकी usefulness सीमित हो सकती है। Testing में भी वही fixed tests सारे नए defects नहीं ढूँढ सकते।

AI की मदद कहाँ मिल सकती है?#

AI tools requirements से candidate scenarios सुझा सकते हैं, historical defects का सार निकाल सकते हैं और coverage gaps के ideas दे सकते हैं। लेकिन AI-generated tests की accuracy, relevance और expected result Tester को verify करने चाहिए।

Remember

Automation test execution को repeat करती है। Test design और maintenance को लगातार सुधारना अलग जिम्मेदारी है।

8. Principle 6 — Testing Is Context Dependent#

English Definition#

Key Idea

Testing approaches and priorities should be adapted to the characteristics, risks, and objectives of the software under test.

Calculator और Online Banking Application की testing एक जैसी नहीं होगी।

Calculator में calculation accuracy, decimals, invalid operations और boundary values महत्वपूर्ण हो सकती हैं। Banking Application में transaction accuracy, authorization, security और data integrity बहुत महत्वपूर्ण हो सकती हैं।

Context Factor Testing पर असर
Purpose कौन-सा behavior जरूरी है
User expectations User के लिए correct result क्या है
Business risk Failure से कितना नुकसान हो सकता है
Architecture कौन-से integrations test करने होंगे
Regulations कौन-सी mandatory checks लागू हैं
Release frequency Tests कब और कितनी बार चलेंगे
Visual Diagram80%

Rendering diagram…

Diagram की शुरुआत tool selection से नहीं, बल्कि application को समझने से होती है। Purpose और risk स्पष्ट होने के बाद testing approach तय होती है।

Healthcare Example#

Entertainment Application में गलत recommendation से परेशानी हो सकती है। Medical Application की गलत calculation patient safety को गंभीर नुकसान पहुँचा सकती है। इसलिए safety-critical systems में applicable standards और risks के अनुसार अधिक कठोर testing की जरूरत हो सकती है।

Remember

One universal testing strategy is not equally suitable for every product.

9. Principle 7 — Absence-of-Defects Fallacy#

English Definition#

Key Idea

Finding and fixing defects does not guarantee product success if the software fails to meet user needs and business objectives.

Food Ordering Application का Example#

मान लीजिए Food Ordering Application में Login, Payment और Order Submission के सारे technical tests pass हैं। लेकिन Customer सही delivery address नहीं चुन पा रहा।

Application crash नहीं हो रहा, पर Customer का मुख्य काम पूरा नहीं हो रहा। ऐसे में passing tests के बावजूद product सफल नहीं कहा जा सकता।

यहाँ दो अलग बातें हैं:

  • Build the product correctly: Implemented behavior technically सही हो।
  • Build the correct product: Product असली user needs पूरी करे।
Visual Diagram80%

Rendering diagram…

इस flow में technical correctness के बाद user needs को अलग से जाँचा गया है। दोनों जरूरी हैं।

Learning Platform Example#

यदि Login, Payment और Course Access सही काम करते हों, लेकिन learners अपने lessons सही क्रम में नहीं पढ़ पा रहे, तो मुख्य learning objective प्रभावित होता है।

इसलिए Tester को Business Requirements, Acceptance Criteria और real user workflows भी समझने चाहिए।

Common Mistake

Zero reported defects का अर्थ यह नहीं कि product अपने उद्देश्य के लिए उपयुक्त है।

10. Real-World QA Decisions में सातों Principles#

एक Shopping Application का release दो सप्ताह में है। Payment और Checkout में पहले अधिक defects मिले हैं। साथ ही नया Discount Feature आया है। Testing Team के पास limited time है।

Principle Practical QA Decision
Presence, Not Absence Passing tests के बाद भी remaining risks report करें
Exhaustive Testing Critical workflows को पहले test करें
Early Testing Discount requirements की अभी review करें
Defect Clustering Payment और Checkout पर focused attention दें
Tests Wear Out नए Discount rules के लिए tests जोड़ें
Context Dependent Financial impact को ध्यान में रखें
Absence-of-Defects Fallacy Complete purchase journey सच में काम करता है या नहीं, जाँचें
Visual Diagram80%

Rendering diagram…

इस flow में QA का काम केवल execution नहीं है। वह शुरुआत में goals समझता है, बीच में risks के आधार पर निर्णय लेता है और अंत में evidence के साथ uncertainties भी report करता है।

11. AI-Powered Testing में इन Principles का उपयोग#

मान लीजिए AI Assistant ने Login Feature के लिए 100 test scenarios बनाए। यह उपयोगी शुरुआती सामग्री हो सकती है। लेकिन संख्या ही quality नहीं बताती। Tester को देखना चाहिए कि scenarios requirements से मेल खाते हैं या नहीं, duplicate तो नहीं हैं, expected results सही हैं या नहीं और important risks छूटे तो नहीं।

Visual Diagram80%

Rendering diagram…

इस workflow में AI suggestions देता है और QA Professional उनकी समीक्षा करता है। Test generation में सहायता मिल सकती है, पर correctness और business relevance की जाँच जरूरी रहती है।

Principle AI-Assisted QA में सीख
Presence, Not Absence AI-generated tests pass होने से zero defects साबित नहीं होते
Exhaustive Testing AI हर possible state cover नहीं कर सकता
Early Testing Requirements में ambiguity ढूँढने में सहायता मिल सकती है
Defect Clustering Defect history से test priorities के सुझाव मिल सकते हैं
Tests Wear Out Test suite के improvement ideas मिल सकते हैं
Context Dependent Suggestions को application-specific context में verify करें
Absence-of-Defects Fallacy User needs की जाँच फिर भी आवश्यक है

12. Common Mistakes#

  1. “सारे tests pass, इसलिए application bug-free है।” Passing tests only cover executed conditions.
  2. “सब कुछ test नहीं हो सकता, इसलिए random tests पर्याप्त हैं।” Risk-based selection जरूरी है।
  3. “Testing केवल development के बाद शुरू होती है।” Requirements और designs की review पहले हो सकती है।
  4. “सबसे ज्यादा defects वाला module हमेशा सबसे risky है।” Severity, impact और changes भी देखें।
  5. “Automation scripts कभी बदलने की जरूरत नहीं।” Software बदलने पर tests review करें।
  6. “हर project के लिए एक ही strategy।” Context के आधार पर strategy बदलती है।
  7. “Zero reported bugs मतलब सफल product।” वास्तविक user needs पूरी होना भी जरूरी है।

13. Knowledge Check#

अब एक छोटा self-check कीजिए।

Interactive questionPractice Question

1. A login feature passes all 20 executed tests. What is the best conclusion?

  1. The feature is guaranteed to be defect-free.
  2. The tested scenarios behaved as expected, but other defects may exist.
  3. No further evaluation is useful.
  4. Every possible condition was covered.

Explanation: Passing tests provide evidence for the executed conditions, not proof of complete defect absence.

इसका मुख्य विचार है कि Tester को observed results के आधार पर ही quality claim करना चाहिए।

14. Hands-On Practice#

Practice 1#

Requirement

Online Learning Platform में Login, Course Purchase, Course Content Access और Profile Picture Upload features हैं। Release में कुछ घंटे बचे हैं।

Your Task

Initial testing priority तय कीजिए और प्रत्येक decision का कारण बताइए।

HintShow Hint

सोचिए कि किस failure से payment, account access या purchased content तक पहुँच प्रभावित होगी।

SolutionShow Solution
Feature Priority Reason
Course Purchase High Payment या order failure
Course Content Access High Purchased lessons unavailable
Login High Account access blocked
Profile Picture Upload Low Usually lower impact on main learning journey

Explanation

यह example business impact के आधार पर initial prioritization बताता है। वास्तविक project में security, defect history और new changes के अनुसार priority बदल सकती है।

Practice 2#

Requirement

Shopping Application के पुराने automated tests pass हैं, लेकिन Coupon Feature के नए rules के लिए tests नहीं बनाए गए।

Your Task

सबसे relevant principle पहचानिए और improvement बताइए।

HintShow Hint

देखिए कि पुरानी test suite नए software behavior को cover करती है या नहीं।

SolutionShow Solution

यह Tests Wear Out principle का उदाहरण है। QA Team को नई requirements पढ़नी चाहिए, existing tests review करने चाहिए, new coupon scenarios जोड़ने चाहिए और useful regression tests बनाए रखने चाहिए।

Explanation

Automation पुरानी checks दोहरा सकती है, लेकिन नए business rules अपने आप cover नहीं होते।

15. Interview Preparation#

What are the seven fundamental testing principles?Show Answer

The seven principles are: testing shows the presence, not the absence, of defects; exhaustive testing is impossible; early testing saves time and cost; defects cluster together; tests wear out; testing is context dependent; and absence-of-defects fallacy.

Key Points:

  • Applicable to both manual and automated testing.
  • Support risk-aware decisions.
  • Do not guarantee defect-free software.

Why interviewer asks this:

Interviewer आपकी testing fundamentals और decision-making समझना चाहता है।


Why is exhaustive testing impossible?Show Answer

Real-world software has too many possible input combinations, environments, states, and execution paths. Testers therefore use systematic selection and risk-based prioritization to achieve valuable coverage.

Key Points:

  • Combination counts grow quickly.
  • Resources and time are limited.
  • Prioritization improves testing value.

Why interviewer asks this:

Interviewer देखता है कि आप limited time में meaningful tests कैसे चुनेंगे।


Explain the Pesticide Paradox.Show Answer

Repeating the same tests without reviewing or updating them may reduce their effectiveness in discovering new defects. Test suites should evolve with changing functionality and risks.

Key Points:

  • Old regression tests can remain useful.
  • New behavior needs new coverage.
  • Test maintenance is essential.

Why interviewer asks this:

यह सवाल Test Suite Maintenance की समझ जाँचता है।


What is the Absence-of-Defects Fallacy?Show Answer

A product can pass technical tests and still fail if it does not meet actual user needs or business objectives. Low defect counts alone do not establish product success.

Key Points:

  • Technical correctness is not the only quality goal.
  • Business requirements matter.
  • Fitness for purpose must be evaluated.

Why interviewer asks this:

Interviewer जानना चाहता है कि आप quality को user value से जोड़ते हैं या नहीं।

16. Quick Revision#

  • Presence, Not Absence: Testing defect-free होने की guarantee नहीं देती।
  • Exhaustive Testing: हर possible combination check करना सामान्यतः संभव नहीं है।
  • Early Testing: जल्द problems पहचानने से rework घट सकता है।
  • Defect Clustering: कुछ modules में defects अधिक मिल सकते हैं।
  • Tests Wear Out: Changing software के साथ Test Suite update करें।
  • Context Dependent: Testing risk और application purpose के अनुसार बदलें।
  • Absence-of-Defects Fallacy: User needs पूरी न हों तो passing tests भी पर्याप्त नहीं हैं।
Summary

एक अच्छा QA Professional केवल tests execute नहीं करता। वह सही risks पहचानता है, useful tests चुनता है, results का सही अर्थ समझता है और बची हुई uncertainties स्पष्ट करता है।

Interactive learning

Practice lab

Apply this chapter with guided activities, immediate feedback, explanations, and retry.

Practice loads when this section enters view.