Share E-Book

Software Craftsmanship Using AI Practical guide for using LLMs in writing, reviewing and testing code (Almantas Karpavičius)(Z-Library)

Author

Rating No ratings yet

Log in to rate

AI
Language English

DESCRIPTION This book is a workshop to create software using AI. A reader will be taken through a series of requirements and create a practical API from scratch. AI is without a doubt a productivity boost, and our goal is to help you maximize the boost by writing prompts effectively to generate, refactor, test, and review code. This book is also a modern take on software design fundamentals. To be able to scrutinize AI-generated code and to be able to guide AI effectively to better results, one should understand the theory behind software design. It starts with basics like clean function design and object-oriented principles, then advances to SOLID principles, design patterns, and Onion architecture. Readers will learn essential testing methods, including unit, integration, and acceptance tests using BDD and Specflow. The guide covers API development, focusing on security, validation, error handling, and external system integration. It also explains CI/CD pipelines using Azure DevOps, including build and deployment pipelines with YAML configurations. Lastly, this book teaches us to embrace the changes in software requirements. The end goal is to teach a reader how to implement changes in software with minimum change to existing lines of code.You will be well-equipped to leverage AI as a valuable asset in your software development toolbox. KEY FEATURES ● Using AI tools to enhance your development process, from code generation to testing. ● Build a real-world "Nutrition Advisor" application from start to finish, applying the concepts and techniques learned throughout the book. ● Discover how to write clean, maintainable code using SOLID principles. WHAT YOU WILL LEARN ● The fundamentals of software design like KISS, OOP, SOLID, and key design Patterns. ● Use Effective prompt engineering for generating code, refactoring, testing, and reviewing. ● Code review both for human and AI-generated code. ● Design which minimizes changes when new requirements are introduced. ● B

Format EPUB
Size 9.1 MB
335
Views

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
【One-Line Pitch】 A hands-on workshop that pairs classic software design fundamentals with practical LLM prompting, teaching you to generate, refactor, test, and review code while building a real "Nutrition Advisor" API from scratch. Best for developers who already write code and want to use AI without sacrificing quality or maintainability. 【Book Arc】 - **Opening (~0%–10%)**: Sets the premise — treat AI as a pair programmer, but only trust it once you understand clean function design, naming, and the risks of shipping unreviewed AI code. - **Early (~10%–30%)**: Builds the design foundation — OOP, SOLID, and design patterns — each introduced through a new Nutrition Advisor requirement, so theory is always tied to a concrete refactor. - **Early–Middle (~30%–40%)**: Moves into testing (unit, TDD, test pyramids) and then wraps the domain in a Web API, showing how quickly AI can scaffold logging, validation, and controllers. - **Middle (~40%–55%)**: Integrates a third-party service (ChatGPT/OpenAPI) and reorganizes the codebase into Onion/Clean Architecture, including an AI-assisted global code review. - **Late (~55%–85%)**: Automates the lifecycle — CI with GitHub Actions (tests, static analysis, coverage) and CD to Azure (App Service, secrets, monitoring, troubleshooting). - **Ending (~85%–100%)**: Final thoughts on prompt craft, what changed with newer GPT versions, and how to keep changes cheap as requirements evolve. 【Key Takeaways】 - **AI amplifies whatever design skill you already have** (Opening): the book's core thesis is that you cannot guide or scrutinize AI output without understanding clean code, so fundamentals come first. - **Every chapter adds a requirement, not just code** (Early): the Nutrition Advisor grows incrementally, and old code is refactored as soon as new knowledge exposes flaws — modeling real change management. - **Design patterns are chosen by context, not memorized** (Early): Facade, Adapter, Strategy, Command, Decorator, and Factory Method appear as answers to specific notification and filtering problems. - **Testing works in both directions with AI** (Early–Middle): you can start from tests (TDD) or from existing code and generate tests, covering unit, integration, smoke, and acceptance (BDD/Specflow) layers. - **Third-party integration deserves a versioned comparison** (Middle): the book swaps an endpoint implementation for an external API call and weighs when each approach fits, plus how to test around external dependencies. - **Architecture is about decoupling business logic from infrastructure** (Middle): Onion Architecture, DTO/model separation, and screaming architecture keep the domain independent of frameworks. - **CI/CD is largely generatable but still needs judgment** (Late): pipelines for build, quality checks, coverage, and Azure deployment are shown as AI-friendly, with attention to secrets, monitoring, and troubleshooting. - **Minimize change to existing lines** (Ending): the stated end goal is adding new components rather than rewriting, so software absorbs evolving requirements gracefully. 【Reading Tips】 - Deep-read the early design chapters (clean functions, OOP, SOLID) — they are the lens you'll use to judge every AI suggestion later. - Skim the Azure/GitHub Actions configuration steps if you already run pipelines; focus instead on the prompt patterns and the reasoning behind each pipeline stage. - Treat the Nutrition Advisor as a lab: type the prompts yourself and compare AI output against the book's refactors rather than reading passively. - Pay attention to the "say no to the business" moment and the code-review-by-AI sections — they show where human judgment must override the tool. - Keep the appendix's prompt tips nearby as a quick reference while working on your own codebase. 【Coverage Limits】 The excerpts cover the book's structure, chapter objectives, and several concrete examples, but do not include full code listings or every prompt used; some chapters are summarized rather than shown in detail.

Passage locations

Excerpt 1
tware design like KISS, OOP, SOLID, and key design Patterns. ● Use Effective prompt engineering for generating code, refactoring, testing, and reviewing. ● C...
View in text
Excerpt 2
serializing, documentation, controllers, request validation. As well as how to test it: smoke and integration tests. The point of this chapter is to show how...
View in text
Excerpt 3
a better testability Writing unit tests Test frameworks in .NET Configuring ChatGPT to help write tests ChatGPT GitHub Copilot Number of test cases required...
View in text
Excerpt 4
: gain muscle, lose weight, gain weight. Let us get started. Let us ask ChatGPT for the formula we will be implementing ( https://chatgpt.com/ ). Type the fo...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
← Back to List