<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Module-2 on Ghafoor's Personal Blog</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/</link><description>Recent content in Module-2 on Ghafoor's Personal Blog</description><generator>Hugo</generator><language>en</language><managingEditor>noreply@example.com (AG Sayyed)</managingEditor><webMaster>noreply@example.com (AG Sayyed)</webMaster><copyright>Copyright © 2024-2026 AG Sayyed. All Rights Reserved.</copyright><atom:link href="http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/index.xml" rel="self" type="application/rss+xml"/><item><title>Test Fixture</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/006-test-fixture/</link><pubDate>Tue, 22 Jul 2025 22:49:17 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/006-test-fixture/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the concept of test fixtures in software testing, detailing their purpose, how they establish a known state for tests, and the mechanisms provided by PyUnit to manage test environments and data for reliable, repeatable results.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="understanding-test-fixtures"&gt;Understanding Test Fixtures&lt;/h2&gt;
&lt;p&gt;Test fixtures are essential tools in software testing, used to establish a known initial state before and after running tests. They ensure that each test starts from a consistent environment, making results reliable and repeatable. Fixtures are especially useful when tests depend on specific data, files, or system states.&lt;/p&gt;</description></item><item><title>Writing Assertion</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/005-writingg-asseertion/</link><pubDate>Tue, 22 Jul 2025 22:47:46 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/005-writingg-asseertion/</guid><description>&lt;p class="lead text-primary"&gt;
This document details the process of writing and refining test assertions, debugging failing tests, and building robust test cases for stack operations using Python's unittest framework.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Writing effective test assertions is a key part of developing reliable software. This module demonstrates a workflow for debugging and improving test cases, using a stack implementation as an example.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="debugging-failing-tests"&gt;Debugging Failing Tests&lt;/h2&gt;
&lt;p&gt;When running tests, failures indicate that either the code or the test needs attention. Test runners like &lt;code&gt;nose&lt;/code&gt; or &lt;code&gt;unittest&lt;/code&gt; can stop at the first failure using the &lt;code&gt;--stop&lt;/code&gt; flag, helping to focus on one issue at a time.&lt;/p&gt;</description></item><item><title>Test Assertion</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/004-test-assertion/</link><pubDate>Tue, 22 Jul 2025 22:44:16 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/004-test-assertion/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the purpose and use of assertions in Python testing, highlights common PyUnit assertions, and explains the importance of testing both happy and sad paths for robust code validation.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Assertions are statements in test cases that check if a condition is true or false. They are essential for determining whether code behaves as expected. If an assertion fails, the test fails, helping identify issues early.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="using-assertions-in-python"&gt;Using Assertions in Python&lt;/h2&gt;
&lt;p&gt;Assertions can be made using Python&amp;rsquo;s built-in &lt;code&gt;assert&lt;/code&gt; statement or with specialized assertion methods provided by test frameworks like PyUnit (unittest). These methods make tests more readable and expressive.&lt;/p&gt;</description></item><item><title>Test Case Anatomy</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/003-test-case-anatomy/</link><pubDate>Tue, 22 Jul 2025 22:19:01 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/003-test-case-anatomy/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the anatomy of a test case, including the use of test fixtures, the importance of assertions, and how frameworks help structure reliable and repeatable tests using a stack example.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;A test case is a fundamental unit in software testing, designed to verify that a specific part of code behaves as expected. Test frameworks provide tools to create, organize, and run these test cases efficiently.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="understanding-the-stack-example"&gt;Understanding the Stack Example&lt;/h2&gt;
&lt;p&gt;A stack is a data structure that follows the Last-In, First-Out (LIFO) principle. Items are added to the top using the &lt;code&gt;push&lt;/code&gt; operation and removed from the top using &lt;code&gt;pop&lt;/code&gt;. The &lt;code&gt;peek&lt;/code&gt; operation allows viewing the top item without removing it.&lt;/p&gt;</description></item><item><title>Test With Nose and Pytest</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/002-test-with-nose/</link><pubDate>Mon, 21 Jul 2025 23:38:11 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/002-test-with-nose/</guid><description>&lt;p class="lead text-primary"&gt;
This document explains how to run Python unit tests using both unittest and Nose, highlights the differences in their reports, and demonstrates how Nose can improve test output and code coverage analysis.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Automated testing is essential for reliable software. Python offers several tools for running unit tests, including the built-in unittest module and the third-party Nose framework. This module explores how to use both tools and interpret their test reports.&lt;/p&gt;</description></item><item><title>Test Driven Development Benefits</title><link>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/001-tdd-benefits/</link><pubDate>Mon, 21 Jul 2025 23:14:01 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/devops-content/devops-pcert/11-tdd-bdd/02-module/001-tdd-benefits/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores the Red/Green/Refactor workflow in Test-Driven Development (TDD), detailing each step and explaining how TDD helps developers write reliable code efficiently by ensuring tests drive the development process.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Test-Driven Development (TDD) is a software development approach that emphasizes writing tests before writing the actual code. This method helps ensure that code meets requirements and works as expected from the start.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-redgreenrefactor-workflow"&gt;The Red/Green/Refactor Workflow&lt;/h2&gt;
&lt;p&gt;TDD is built around a simple but &lt;code&gt;powerful cycle&lt;/code&gt; known as &lt;code&gt;Red/Green/Refactor&lt;/code&gt;. This workflow consists of three main steps:&lt;/p&gt;</description></item></channel></rss>