Skip to content

Commit bf986a7

Browse files
update read me with theory
1 parent 1796b6a commit bf986a7

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,135 @@ Define custom equivalence classes and settings for each input type:
495495
| Precise | Regression suites, CI pipelines, validation of well-defined rules |
496496

497497
---
498+
## 🧠 Theory and Metaheuristic Foundations
498499

500+
Testimize leverages classical testing techniques enhanced by powerful metaheuristics to produce compact, high-value test cases. Below we explain the core test design principles and the intelligent optimization behind Hybrid ABC.
501+
502+
---
503+
504+
### 🔍 Classical Test Design Techniques
505+
506+
#### ✅ Equivalence Partitioning (EP)
507+
Equivalence Partitioning divides input data into groups where values are assumed to behave the same. Only one representative is tested from each class.
508+
509+
**Example:**
510+
For input 1–100, equivalence classes are:
511+
- Valid: [1–100]
512+
- Invalid: <1, >100
513+
514+
Testimize uses this in both **Exploratory** and **Precise** modes via predefined or custom equivalence classes.
515+
516+
---
517+
518+
#### ✅ Boundary Value Analysis (BVA)
519+
BVA focuses on values at the edge of valid and invalid ranges where bugs frequently occur.
520+
521+
**Example:**
522+
For 1–100, test:
523+
- 0 (invalid), 1 (min), 100 (max), 101 (invalid)
524+
525+
In Testimize, BVA is automatically added when using boundary-aware data parameters like:
526+
```csharp
527+
.AddInteger(1, 100)
528+
```
529+
530+
---
531+
532+
#### ✅ Pairwise Testing
533+
Pairwise ensures every pair of input parameters is tested in all combinations, significantly reducing test count while maintaining interaction coverage.
534+
535+
**Example:**
536+
3 fields with 3 values →
537+
- Full combo: 27 cases
538+
- Pairwise: ~9 cases
539+
540+
Use it via:
541+
```csharp
542+
settings.Mode = TestGenerationMode.Pairwise;
543+
```
544+
545+
---
546+
547+
#### ✅ Combinatorial Testing
548+
All combinations of all inputs. Use when you need **exhaustive** coverage (e.g., <4 fields).
549+
550+
```csharp
551+
settings.Mode = TestGenerationMode.Combinatorial;
552+
```
553+
554+
Combine with fitness filtering:
555+
```csharp
556+
settings.Mode = TestGenerationMode.CombinatorialOptimized;
557+
```
558+
559+
---
560+
561+
## 🐝 Hybrid Artificial Bee Colony (ABC)
562+
563+
Hybrid ABC is a swarm-based optimization algorithm inspired by bee foraging behavior. It generates **small but effective test sets** by maximizing test case fitness.
564+
565+
---
566+
567+
### 🎯 How Hybrid ABC Works
568+
569+
Each test case is a **"food source"**. Bees explore and refine these:
570+
571+
- **Employed bees** mutate current test cases.
572+
- **Onlooker bees** choose promising ones to exploit based on fitness.
573+
- **Scout bees** randomly generate new ones after stagnation.
574+
575+
---
576+
577+
### ⚙️ Key Enhancements in Testimize
578+
579+
| Feature | Purpose |
580+
|-----------------------------|---------|
581+
| **Elite selection** | Keeps top test cases across generations. |
582+
| **Simulated annealing** | Allows accepting worse solutions early to escape local optima. |
583+
| **Cooling rate** | Gradually lowers mutation intensity over time. |
584+
| **RCL (restricted candidate list)** | Selects test cases probabilistically for balanced search. |
585+
| **Mutation uniqueness** | Accepts only improving mutations (hill climbing). |
586+
| **Tabu-like behavior** | Avoids regenerating previously seen test cases. |
587+
588+
---
589+
590+
### 🧮 Fitness Function Details
591+
592+
Each test case receives a fitness score based on:
593+
594+
| Value Category | Score |
595+
|-----------------------|-------|
596+
| Boundary Valid | +20 |
597+
| Valid | +2 |
598+
| Boundary Invalid | -1 |
599+
| Invalid | -2 |
600+
| **New unique value** | +25 |
601+
602+
If `AllowMultipleInvalidInputs=false`, then for each extra invalid parameter:
603+
- **Penalty = -50 × (invalidCount)**
604+
605+
**Formula:**
606+
```
607+
F(t) = Σ score(value) + Σ uniqueness bonuses - invalid penalties
608+
```
609+
610+
This scoring:
611+
- Promotes **diversity**
612+
- Maximizes **coverage of categories**
613+
- Penalizes test cases that are too negative
614+
615+
---
616+
### ✅ When to Use What
617+
618+
| Use Case | Suggested Mode |
619+
|----------------------------------|----------------|
620+
| Fast exploration of inputs | Exploratory + Pairwise |
621+
| Maximum fault detection | Precise + Hybrid ABC |
622+
| Stable CI-friendly generation | Precise + ABC + fixed Seed |
623+
| Form/API validation coverage | Exploratory + ABC |
624+
| Performance-sensitive test sets | ABC + FinalPopulationSelectionRatio < 0.5 |
625+
626+
---
499627
## 🔧 ABCGenerationSettings Explained
500628

501629
The `ABCGenerationSettings` class contains all the configuration options for the HybridArtificialBeeColonyTestCaseGenerator. Here's a breakdown of each property:

0 commit comments

Comments
 (0)