This project is a web-based application developed as part of a Software Quality Assurance assignment. It demonstrates both functional correctness and software engineering best practices, particularly the application of SOLID principles in frontend JavaScript.
The system performs:
- User authentication
- Triangle validation (triangularity check)
- Triangle classification (Equilateral, Isosceles, Scalene)
- Pythagorean (Right Triangle) detection
- Username must be exactly 6 letters
- Password must contain
SWUSTCST - Real-time validation with visual feedback
-
Validates triangle using triangle inequality theorem
-
Classifies triangle into:
- Equilateral
- Isosceles
- Scalene
-
Detects Right Triangle (Pythagorean condition)
-
Modern glassmorphism design
-
Responsive layout
-
Side-by-side result panels:
- Pythagorean Check
- Triangle Type
-
Smooth animations and transitions
project/
│
├── index.html # UI structure
├── style.css # Styling and layout
├── app.js # Application logic (SOLID architecture)
└── README.md # Documentation
Each class has a single responsibility:
Triangle→ geometric logicAuthService→ authenticationAppController→ UI coordination
Triangle classification is extensible:
- New classifiers (e.g., ObtuseTriangle) can be added without modifying existing code.
All classifiers implement the same interface:
classify(triangle)They can be used interchangeably.
Small, focused abstractions:
ValidatorTriangleClassifier
No unnecessary dependencies.
Dependencies are injected into the controller:
new AppController(authService, triangleService);This improves:
- Testability
- Flexibility
- Maintainability
User enters:
- Username (validated with regex)
- Password (validated with substring check)
User inputs three numbers.
- Triangle validity is checked
- Classification is performed
- Pythagorean condition is evaluated
Results are displayed side-by-side:
- Triangle Type
- Pythagorean Result
| Input | Expected Output |
|---|---|
| 3, 4, 5 | Scalene + Right |
| 5, 5, 5 | Equilateral |
| 5, 5, 3 | Isosceles |
| 1, 2, 3 | Not a Triangle |
- Clone or download the repository
- Open
index.htmlin any modern browser - No additional setup required
-
Add unit testing framework
-
Visualize triangle using Canvas API
-
Extend classification:
- Acute triangle
- Obtuse triangle
-
Convert to React or Vue architecture
-
Add backend authentication
This project is designed to:
- Demonstrate clean code architecture
- Apply SOLID principles in practice
- Improve UI/UX design skills
- Prepare for software inspection and evaluation
Muhammed Ahmed
This project is for educational purposes.