<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Daffa Abhipraya</title><link>https://blog.abhipraya.dev/tags/python/</link><description>Recent content in Python on Daffa Abhipraya</description><generator>Hugo</generator><language>en-us</language><copyright>© Daffa Abhipraya</copyright><lastBuildDate>Fri, 13 Mar 2026 00:00:00 +0700</lastBuildDate><atom:link href="https://blog.abhipraya.dev/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>PPL: SOLID and Layered Architecture [Sprint 1, Week 3]</title><link>https://blog.abhipraya.dev/ppl/part-b/s1w3-programming/</link><pubDate>Fri, 13 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s1w3-programming/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>This week&amp;rsquo;s invoice management feature (MR !12) required a full CRUD stack with filtering, sorting, auth enforcement, and business validation (status transitions, admin-only delete). Building this properly meant enforcing strict layer boundaries and handling the tension between HTTP concerns and domain logic.&lt;/p>
&lt;h2 id="the-three-layer-pattern-in-practice">
 &lt;a class="anchor" href="#the-three-layer-pattern-in-practice" data-anchor="the-three-layer-pattern-in-practice" aria-hidden="true">#&lt;/a>
 The Three-Layer Pattern in Practice
&lt;/h2>
&lt;p>SIRA&amp;rsquo;s backend follows Router → Service → DB, where each layer has a single responsibility:&lt;/p></description></item><item><title>PPL: Test-Driven Development [Sprint 1, Week 3]</title><link>https://blog.abhipraya.dev/ppl/part-b/s1w3-tdd/</link><pubDate>Fri, 13 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s1w3-tdd/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>This week shipped three full-stack features using strict TDD discipline: invoice management (CRUD + filtering), layout/dashboard (sidebar, header, dashboard with role-based navigation), and a payments sidebar navigation link. Each feature followed red-green-refactor with tagged commits.&lt;/p>
&lt;p>The project now has &lt;strong>392 backend tests&lt;/strong> and &lt;strong>195 frontend tests&lt;/strong> (587 total), up from 51 last week.&lt;/p>
&lt;h2 id="red-green-refactor-commit-discipline">
 &lt;a class="anchor" href="#red-green-refactor-commit-discipline" data-anchor="red-green-refactor-commit-discipline" aria-hidden="true">#&lt;/a>
 Red-Green-Refactor Commit Discipline
&lt;/h2>
&lt;p>Every feature branch this week followed tagged commits so the TDD flow is auditable from the git history alone.&lt;/p></description></item><item><title>PPL: Test-Driven Development in a FastAPI Project [Sprint 1, Week 2]</title><link>https://blog.abhipraya.dev/ppl/part-b/s1w2-tdd/</link><pubDate>Wed, 04 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s1w2-tdd/</guid><description>&lt;p>TDD forces you to think about the interface before the implementation. This post covers how it was applied in the Smart Invoice Reminder AI (SIRA) backend for Sprint 1.&lt;/p>
&lt;h2 id="test-distribution">
 &lt;a class="anchor" href="#test-distribution" data-anchor="test-distribution" aria-hidden="true">#&lt;/a>
 Test Distribution
&lt;/h2>
&lt;p>The API currently has 51 test functions across 4 files:&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>File&lt;/th>
 &lt;th>Tests&lt;/th>
 &lt;th>Scope&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>&lt;code>tests/test_auth.py&lt;/code>&lt;/td>
 &lt;td>14&lt;/td>
 &lt;td>JWT validation, RBAC, DB queries&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;code>tests/test_payments.py&lt;/code>&lt;/td>
 &lt;td>24&lt;/td>
 &lt;td>Payment CRUD, business logic, edge cases&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;code>tests/test_db_schema_and_seed.py&lt;/code>&lt;/td>
 &lt;td>6&lt;/td>
 &lt;td>Migration integrity, seed validation&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;code>tests/test_logging_middleware.py&lt;/code>&lt;/td>
 &lt;td>7&lt;/td>
 &lt;td>HTTP access logging, request/response capture&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="red-green-refactor">
 &lt;a class="anchor" href="#red-green-refactor" data-anchor="red-green-refactor" aria-hidden="true">#&lt;/a>
 Red-Green-Refactor
&lt;/h2>
&lt;p>The authentication feature (&lt;a href="https://linear.app/ppl-sira/issue/SIRA-26">SIRA-26&lt;/a>) followed strict TDD commit discipline. Each backend function got its own RED commit (failing test) followed by a GREEN commit (passing implementation) before any cleanup.&lt;/p></description></item></channel></rss>