1
Concept 01
Variables
Definition
A variable stores data that can change during program execution. Think of it as a labeled box that holds a value — and that value can be replaced at any time.
🔍 QA Thinking
- Test valid values — expected input the system should accept
- Test invalid values — wrong type, wrong format, unexpected data
- Test boundary values — min, max, empty, null
- Ask: what happens if the variable is never assigned a value?
Example — Field: userAge
let userAge = 25; // ✅ Valid let userAge = 0; // ⚠️ Edge case — is 0 a valid age? let userAge = -1; // ❌ Invalid — negative age let userAge = null; // ❌ Invalid — no value provided let userAge = "abc";// ❌ Invalid — wrong type (string)
| Test Input | Expected Result | Status |
|---|---|---|
| 25 | Accepted | ✅ Pass |
| 0 | Edge case — verify system behavior | ⚠️ Review |
| -1 | Validation error shown | ❌ Should fail |
| null | Required field error | ❌ Should fail |
| "abc" | Type error / validation message | ❌ Should fail |
💡 Why this matters for QA
Understanding variables helps you design test cases that cover valid, invalid, and boundary scenarios. Every input field in an application is backed by a variable — knowing that helps you ask: what values can break it?
🔍 Quick Check
Test your understanding of Variables
2
Concept 02
Data Types
Definition
Data types define the kind of data a variable can hold. The most common types are: String (text), Integer (whole numbers), Float (decimal numbers), and Boolean (true/false).
🔍 QA Thinking
- Verify the system handles the correct data type as expected
- Test what happens when a wrong type is submitted
- Check type conversions — does "123" behave like 123?
- Validate edge cases: empty strings, zero, false vs null
Example — Field: phoneNumber
// String (correct type for phone) phoneNumber = "3001234567" // ✅ Valid string phoneNumber = 3001234567 // ⚠️ Integer — leading zeros lost phoneNumber = "ABC123" // ❌ Invalid format phoneNumber = "" // ❌ Empty string phoneNumber = true // ❌ Wrong type (Boolean)
| Input | Type | Expected | Status |
|---|---|---|---|
| "3001234567" | String | Accepted | ✅ |
| 3001234567 | Integer | Leading zeros may be lost | ⚠️ |
| "ABC123" | String | Format validation error | ❌ |
| "" | Empty | Required field error | ❌ |
💡 Why this matters for QA
Data type mismatches are one of the most common sources of bugs. A field expecting a String that receives an Integer can cause silent failures, data corruption, or crashes — especially in APIs and databases.
🔍 Quick Check
Test your understanding of Data Types
3
Concept 03
Conditional Statements
Definition
Conditional statements allow the system to make decisions based on certain conditions. If a condition is true, one block of code runs. If false, another runs. This is the foundation of all system behavior.
🔍 QA Thinking
- Always test both the TRUE path and the FALSE path
- Verify error messages or actions appear correctly on each path
- Test boundary conditions — what happens exactly at the threshold?
- Check for missing else branches — what if neither condition is met?
Example — Login Page
if (credentials.areValid()) { redirectTo("dashboard"); // ✅ TRUE path } else { showError("Invalid login"); // ❌ FALSE path }
| Condition | Expected Result | Status |
|---|---|---|
| Valid credentials | Redirect to Dashboard | ✅ TRUE path |
| Invalid password | Show error message | ❌ FALSE path |
| Valid email, wrong password | Show error — not redirect | ❌ Must test |
| Empty fields submitted | Validation before if/else | ⚠️ Edge case |
💡 Why this matters for QA
Every feature has conditional logic. Testing only the happy path (the TRUE branch) is the most common QA mistake. The FALSE path is where most production bugs live — especially missing error messages, wrong redirects, and silent failures.
🔍 Quick Check
Test your understanding of Conditionals
4
Concept 04
Loops
Definition
Loops repeat a block of code until a condition is met. A for loop runs a set number of times. A while loop runs as long as a condition is true. Loops power lists, pagination, notifications, and more.
🔍 QA Thinking
- Test minimum iterations — what happens with 0 items?
- Test maximum iterations — does the loop have a limit?
- Check performance — what if the loop runs 10,000 times?
- Verify off-by-one errors — does it show 10 or 11 items?
- Test empty state — what does the user see with no data?
Example — Display last 10 messages
for (let i = 0; i < 10; i++) { displayMessage(messages[i]); } // QA asks: what if messages.length is 0? 5? 50?
| Scenario | Expected Result | Status |
|---|---|---|
| 10 messages exist | Display all 10 | ✅ |
| 0 messages | Display empty state message | ✅ Must test |
| 50 messages exist | Display only last 10 | ✅ |
| 1 message | Display 1, not crash | ⚠️ Edge case |
💡 Why this matters for QA
Loops are behind every list, table, notification feed, and search result in an application. Testing empty states and maximum limits catches the bugs that only appear in real usage — not in the developer's test environment with 3 items of sample data.
🔍 Quick Check
Test your understanding of Loops
5
Concept 05
Functions
Definition
A function is a reusable block of code that performs a specific task. It takes inputs (parameters), executes logic, and returns an output. Functions are the building blocks of every feature in an application.
🔍 QA Thinking
- Test valid inputs — does the function return the correct output?
- Test invalid inputs — does it handle errors gracefully?
- Test edge cases — zero, negative numbers, empty strings
- Verify consistent results — same input should always return same output
- Check what happens when required parameters are missing
Example — calculateDiscount(price, discountRate)
function calculateDiscount(price, discountRate) { return price - (price * discountRate / 100); } calculateDiscount(100, 10) // → 90 ✅ calculateDiscount(0, 10) // → 0 ✅ calculateDiscount(-50, 10) // → ❌ Should return error calculateDiscount(100, 110) // → ❌ >100% discount?
| Input | Expected Output | Status |
|---|---|---|
| (100, 10) | 90 | ✅ |
| (0, 10) | 0 | ✅ |
| (-50, 10) | Error — negative price | ❌ Should fail |
| (100, 110) | Error — discount over 100% | ❌ Should fail |
| (100, 0) | 100 — no discount applied | ⚠️ Edge case |
💡 Why this matters for QA
Every button click, form submission, and API call triggers a function. Testing a function's inputs and outputs systematically — especially invalid and edge cases — is the essence of test design. This is Equivalence Partitioning and BVA applied to code.
🔍 Quick Check
Test your understanding of Functions
6
Concept 06
Arrays / Lists
Definition
An array stores multiple values in a single variable, in an ordered sequence. Arrays are used everywhere: shopping carts, search results, notification lists, user permissions. Each item has an index starting at 0.
🔍 QA Thinking
- Test adding, removing, and updating items
- Check behavior for empty arrays — does the UI show an empty state?
- Test maximum size — is there a limit? What happens when exceeded?
- Validate index boundaries — first item, last item, item beyond end
- Test duplicate values — are they allowed or filtered?
Example — Shopping Cart: cartItems[]
let cartItems = []; // Empty cart cartItems.push("shoes"); // Add item → count = 1 cartItems.push("shirt"); // Add item → count = 2 cartItems.splice(0, 1); // Remove first → count = 1 // QA: what if we push beyond the max cart limit?
| Action | Expected Result | Status |
|---|---|---|
| Add 3 items | Count = 3, all displayed | ✅ |
| Remove 1 item | Count decreases by 1 | ✅ |
| Empty cart checkout | Error — cart is empty | ❌ Must test |
| Add item beyond max limit | Error message shown | ❌ Must test |
| Add duplicate item | Increases quantity or blocks | ⚠️ Define behavior |
💡 Why this matters for QA
Arrays power every list you see in an application. Cart items, search results, user permissions, notification feeds — all arrays. Empty state testing and boundary testing on arrays catches the bugs that appear in real-world usage, not demo environments.
🔍 Quick Check
Test your understanding of Arrays
7
Concept 07
Basic OOP Concepts
Definition
Object-Oriented Programming organizes code around objects. A Class is a blueprint. An Object is an instance of that class. A Method is a function inside a class. Think of a Class as a cookie cutter and Objects as the cookies.
🔍 QA Thinking
- Test object behavior — does the object do what the class defines?
- Verify method outputs under valid and invalid conditions
- Ensure objects interact correctly — does User interact with Order correctly?
- Test state changes — does updating one property affect others?
Example — Class: User / Method: updateEmail()
class User { constructor(name, email) { this.name = name; this.email = email; } updateEmail(newEmail) { if (!isValidEmail(newEmail)) throw new Error("Invalid email"); this.email = newEmail; } } const user = new User("Watson", "user@example.com"); user.updateEmail("user@example.com"); // ✅ user.updateEmail("notanemail"); // ❌ Should throw error user.updateEmail(""); // ❌ Empty — should fail
| Input to updateEmail() | Expected Result | Status |
|---|---|---|
| "user@example.com" | Email updated successfully | ✅ |
| "notanemail" | Validation error thrown | ❌ Should fail |
| "" | Required field error | ❌ Should fail |
| "user@example.com" | No change or duplicate check | ⚠️ Define behavior |
💡 Why this matters for QA
Modern applications are built with OOP. Understanding that every feature maps to a class and its methods helps you write more targeted test cases. When a developer says "the User object's updateEmail method failed" — you'll know exactly what to test and where to look.
🔍 Quick Check
Test your understanding of OOP