We are all Testers !!!

Published on August 3, 2024

Are we all Testers?

Depicting AI testing coffee

From the moment we wake up, we start testing. The alarm clock goes off, and we instinctively check if the sound is just right — not too harsh, not too soft. Did it wake us up as expected? If yes, the alarm app passes the test; if no, it’s time to adjust settings or look for a better app.

Moving to breakfast, we taste our coffee. Is it the perfect blend, the right temperature? If not, we adjust, change, or learn how to do it! Similarly, a tester runs multiple test cases to ensure software features meet the desired requirements or standards. We pass or fail the coffee test based on our criteria for a good cup, much like software testers use requirements to approve or improve features.

The Marketplace of Ideas

Every product or service we encounter undergoes our exploration, and so our testing. Trying on clothes, we check for fit, comfort, and style — effectively running usability and performance tests. When we recommend a restaurant or a book to a friend, we’ve conducted an end-to-end test, ensuring the experience meets quality standards.

Just as in software testing, where we provide feedback to developers, we give our insights to product makers through reviews and ratings. This feedback loop is crucial in both sides, driving improvements and innovation based on meaningful testing, meaningful research.

Test scenario not necesario

Imagine we’re testing a smart coffee machine app to ensure it meets our standards, or even better, imagine we are sending an android to test the coffee temperature, wait, what?

// Importing necessary packages
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class AndroidCoffeeTemperatureTest {

WebDriver driver;

@BeforeTest
public void setUp() {
// Setting up the Chrome driver
System.setProperty("webdriver.chrome.driver", "path/to/chromedriver");
driver = new ChromeDriver();
}

@Test
public void testCoffeeTemperature() {
// Navigate to the smart coffee machine app
driver.get("https://www.smartcoffeemachine.com");

// Check if the page loads
String pageTitle = driver.getTitle();
Assert.assertTrue(pageTitle.contains("Smart Coffee Machine"), "Oh no! The coffee machine's website didn't load. Maybe it needs a coffee break?");

// Select coffee type and strength
driver.findElement(By.id("coffeeType")).sendKeys("Espresso");
driver.findElement(By.id("strength")).sendKeys("Strong");

// Brew coffee
driver.findElement(By.id("brewButton")).click();

// Assert coffee is being brewed
String status = driver.findElement(By.id("status")).getText();
Assert.assertTrue(status.contains("Brewing"), "Brewing status failed! The machine must be on a coffee strike.");

// Check if coffee is ready
driver.findElement(By.id("checkButton")).click();
String finalStatus = driver.findElement(By.id("status")).getText();
Assert.assertTrue(finalStatus.contains("Ready"), "Coffee isn't ready. Maybe it prefers to remain in bean form?");

// Test coffee temperature
driver.findElement(By.id("temperatureButton")).click();
String temperature = driver.findElement(By.id("temperature")).getText();

try {
int tempValue = Integer.parseInt(temperature.replace("°C", "").trim());
Assert.assertTrue(tempValue <= 70, "Temperature too hot! The coffee might as well be lava.");
System.out.println("Temperature is safe. The coffee is ready to be enjoyed.");
} catch (NumberFormatException e) {
Assert.fail("Failed to read the temperature. Did the coffee machine malfunction or did the coffee become sentient?");
} catch (AssertionError e) {
System.out.println("Warning: Coffee temperature exceeds safe limits. Initiating emergency shutdown to prevent hardware meltdown.");
System.out.println("Error: The android's OS is overheating. Shutting down...");
driver.quit();
throw e;
}

// Clean up
driver.quit();
}
}

Restarting …