Software Engineering for Absolute Beginners (Nico Loubser)(Z-Library)
Software
No Description
13
Views
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Page
1
(This page has no text content)
Page
2
Nico Loubser Software Engineering for Absolute Beginners Your Guide to Creating Software Products 1st ed.
Page
3
Nico Loubser London, UK Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www. apress. com/ 978-1-4842-6621-2. For more detailed information, please visit www. apress. com/ source-code. ISBN 978-1-4842-6621-2 e-ISBN 978-1-4842-6622-9 https://doi.org/10.1007/978-1-4842-6622-9 © Nico Loubser 2021 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, speciically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a speciic statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have
Page
4
been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional afiliations. Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, Suite 4600, New York, NY 10004- 1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, email orders- ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Page
5
This book is dedicated to Kim, who keeps me going when I feel like stopping.
Page
6
Introduction Writing software is a multi-disciplinary exercise. This makes it especially dificult for people who want to learn how to create software but are without someone guiding them and helping them navigate their way between all of the technologies and methodologies there are to learn. The aim of this book is not just to teach, but also to guide the newcomer, showing where the learning efforts should be concentrated, what is good practice, and what are some of the industry standards in the current software development industry. This book bridges the divide between just writing code and creating software systems. About This Book This book is not just for the complete newcomer. It is also for someone who can already write code, but is interested in creating complete software projects, from inception to delivery, as well as software design practices. As a software developer, I can wholeheartedly tell you that writing code is only a part of today’s software development paradigm. In today’s world, you need to have learned, and in some cases mastered, a set of speciic tools, skills, and methodologies that will help you achieve your goals as a creator of software. Whether that goal is to become a hobbyist developer, whether you want to create a startup or work for a corporation, good software engineering skills are very important. Most people will pick up a book about programming, or go on the Internet and start learning how to write code. Very few people will read a book on software engineering principles, and not everyone is so lucky to start in a job where serious engineering principles are followed and enforced and where proper tools are used. Why Are Good Practices Essential? Certain principles in software development remain the same, regardless of which company you work for. If you consider a company with 200 employees and a 1,000,000 clients, and compare it to a company with 2 employees and 150 customers, you should notice two
Page
7
things. The bigger company has different problems to solve with regards to infrastructure, scalability, and keeping their code base clean with a potentially large development team. The second thing you should notice is that both companies also have similar problems to solve, such as security, keeping the code base clean, deployments, writing clean code, and using proper software engineering principles to design good code. Even if you build a website for your cousin’s brake skimming business, security, proper coding principles, and architectural principles are very important. A company that serves 100 customers a month should not have its software written in an ad hoc, shoot-from-the-hip fashion. If your complete user base, whether it is 100 people or 1,000,000 people, depends on a software product, then it means buggy code will affect 100% of your client base. No company can afford to have their client base affected to this extent. By no means does this book suggest to over-engineer your software solutions. If you are writing software that reads the temperature in your garden into a database every minute of every day, emails you a graph every month, and your brother can log in online to check the temperature in your garden, then you don’t need a supercool Kubernetes cluster on AWS. You do, however, need a clean code design that is easily modiiable, secure code, and version control. You may think no one will hack into your system, and you will be dead wrong. Not all hacking is for inancial gain. Some hacking attempts are for bragging rights, which is more than enough incentive to deface your website. If a simple input ield is left unprotected, like a telephone number input ield, your whole database can be trashed, stolen, or corrupted. Why Did I Write This Book? A while ago a friend started to learn how to program. He struggled initially because some of the concepts that were covered were intended for someone with a coding background. Reviewing the literature he was using, I noticed that they also basically all excluded a comprehensive approach to creating software. I saw this as two problems. Firstly, some of the beginner material out there caters to people with some
Page
8
knowledge about programming. This is not the end of the world. You are all intelligent enough to put the pieces together and learn from material that is intended for someone with more knowledge. But it was this aspect that made learning more dificult for my friend. Secondly, there was also the absence of the processes to build comprehensively good systems. So I decided to create this book. My aim for this book is to show a complete beginner the cornerstones of creating easily readable, maintainable, editable, and releasable software that can be adapted and changed as needed. I wanted to touch on the principles and knowledge needed to create great software products—more aspects of software development than just writing code. As mentioned, software engineering is a vast discipline that requires many technical skills and knowledge to create great software products. Good software methodologies, tools, and approaches go back a very long time. Having said that, today’s software development world is different from what I was generally exposed to when I started out in the early 2000s. Back then, we manually FTP’d our iles to the server. Before we FTP’d anything, we would make a copy of that script on the server. It was not uncommon to see iles with names such as index_1.php, index_backup.php, and index_final_backup.php. File management is now handled by version control software. Version control systems are not new, but I believe they are now incredibly widespread and more commonplace than ever before. I also believe they are imperative to a programming project.
Page
9
How This Book Is Organized Since the intent of this book is to teach you most of the basic aspects of creating software products, it has been designed so that the chapters build on each other. The irst three chapters look at setting up your system. Chapter 1 looks at software editors, Chapter 2 looks at setting up your software environment using containerization, and Chapter 3 looks at setting up your source control system where you can save your project remotely. These irst three chapters form the basis on which you create software and what your software runs on. Chapter 4 teaches you how to write code using Python. The work in Chapters 1, 2 and 3 contribute to this chapter. Chapter 5 builds on Chapter 4, showing you how to write better code. Chapter 6 shows how to design databases. Taking Chapters 4, 5 and 6 in consideration, you can move on to Chapter 7, in which you build a small project using the skills you learned in the preceding chapters. Chapter 8 teaches you how to test for code quality, and Chapter 9 looks at design concepts. Chapter 10 looks at security issues, and we round it all off with Chapter 11, where you look at hosting your software, as well as continuous integration and deployment.
Page
10
Acknowledgments This book would not have been possible without all of the junior developers I have mentored over the years, as this is where my inspiration for this book originated. I would also like to thank Andy Beak for reviewing this book, and in doing so, improving the quality of it. Lastly, to the team at Apress who helped me produce and publish this book, thank you very much.
Page
11
Table of Contents Chapter 1: Editors The Different Families of Programming Editors Shell-Based Editors Text Editors IDEs The Beneits of an IDE or an Editor like VS Code Installing Visual Studio Code Workspaces Built-In Features Features to Install Summary Chapter 2: Containerizing Your Environment What Are Containers? The Main Components of Docker Explained The Dockerile The Docker Image Docker Containers Setup and Usage Preparation How to Install Docker Creating the Dockerized Environments for Your Software’s Infrastructure Preparations Before You Start Cooking First Docker Image and Container Building the Image and Pushing It to the Repository
Page
12
Pushing the Image to a Docker Repository Docker Orchestration with Docker Compose Final Docker Experiment Docker Checklist and Cheat Sheet Docker Commands Docker-compose Commands Chapter 3: Repositories and Git A Word About Windows Git Usage and Hidden Files What Is Source Control? Additional Functionality Installing Git and Creating a GitLab Account Using GitLab Commits Branches A More Advanced Use Case Merging Conlicts Removing the Need to Type Your Password Every Time: SSH Gitignore git stash git reset and revert Cheat Sheet Chapter 4: Programming in Python What Is Programming? Python Setup for This Chapter and How to Use It Basics
Page
13
Commenting Your Code Variables Sequences and Maps Lists and Strings Tuples When to Use a List and When to Use a Tuple Dictionaries Decision-Making Operators and Structures Operators Scope and Structure of Python Code Control Statements Functions Custom Functions Classes and Objects The Anatomy of a Class Instantiating the Class Inheritance Polymorphism Composition Magic Methods Exceptions The Anatomy of an Exception Raising an Exception Catching an Exception Writing an Exception Imports
Page
14
Static Access to Classes Cheat Sheet Scope Variables Arrays Control statements Functions Classes Exceptions Import Reference Chapter 5: Object Calisthenics, Coding Styles, and Refactoring Object Calisthenics 1. Do not exceed one level of indentation per method. (Or rather, limit the levels of indentation as much as you can. ) 2. Do not use the else keyword 3. Wrap all primitives and strings 4. Use only one dot per line 5. Do not abbreviate 6. Keep entities small 7. Limit classes to use no more than two instance variables 8. Use irst-class collections Refactoring Code Coding Styles Linting Commenting Your Code
Page
15
Maximum Line Length Indentation Blank Lines Encoding Imports Whitespace Naming Conventions Chapter Summary References Chapter 6: Databases and Database Design Three Things You Can Do with Data Overview of Database System Components Setting Up Your DBMS Ports Environment Volumes The Final Docker File Viewing Your Database Using Adminer Cleaning Up and Pushing to the Remote Preparing Your Database Primary Keys Indexes Index Caveats Data Types Creating a Database Creating the Table
Page
16
Filling the Database with Data Your First SQL Queries Normalizing the Current Classes Table First Normal Form Second Normal Form Third Normal Form Last Word on Joins Conclusion Cheatsheet and Checklist References Chapter 7: Creating a RESTful API: Flask The Project What Is REST? JSON HTTP Verbs REST Query Routes HTTP Status Code HATEOAS The Technology You Will Use Setting Up the Environment Creating the GitLab Project Project Layout Creating the docker-compose and Docker Files The Final Steps: Coding The ORM Version GET Endpoint
Page
17
POST Endpoint PATCH Endpoint DELETE Endpoint Takeaway of This Chapter References Chapter 8: Testing and Code Quality Overview of Code Quality Steps Automated Testing Unit Tests How to Run the Unit Test Integration Tests How to Run the Integration Test A Last Issue and Some Refactoring Testing the New Code The Downside of Automated Testing The Validity of the Tests Time Pressure Peer Reviews Walk-Through Staging Environment and UAT Chapter 9: Planning and Designing Your Code Software Development Lifecycle Why Use a Software Development Lifecycle? Steps in the SDLC Modelling Where Does Modelling Fit In the SDLC?
Page
18
Why Create Diagrams and Models? Tools High-Level Models and Diagrams Low-Level Models Summary Chapter 10: Security Securing Your Code Code-Level Security SQL Injection Cleaning Variables Keeping Errors a Secret XSS CSRF Session Management System-Level Security Keep Your Systems Up to Date Database Users Ports Docker Images HTTPS Password Policy Social Engineering Summary Chapter 11: Hosting and CI/ CD Types of Hosting Cloud and Serverless Technologies
Page
19
Shared Hosting Virtual Private Hosting Cloud Hosting Serverless Which Hosting Technology to Choose? Continuous Integration and Continuous Deployment (CI/ CD) Creating the Pipeline Summary Index
Page
20
About the Author Nico Loubser is a software engineer by trade, with 16 years of experience in various industries and technologies. As an experienced team lead, he has mentored numerous developers and has developed a passion for it, which was the inspiration for writing this book. He believes that the so-called software crisis1 can be alleviated by proper mentorship, but that mentorship is not always available. He currently lives in London, where he seeks exposure to an even greater variety of ideas, methods, and technologies in today’s software development industry. He holds a post- graduate degree in software engineering from the University of South Africa.
The above is a preview of the first 20 pages. Register to read the complete e-book.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
【One-Line Pitch】
A guided on-ramp for people who can already write a little code but have never built a real software system: it teaches the tools, workflows, and engineering habits that turn isolated scripts into deployable, testable, version-controlled projects. Best for self-taught beginners, career switchers, and hobbyists who want industry-standard practice without a mentor.
【Book Arc】
- **Opening (~0%–10%)**: Sets the premise — writing code is only part of software development — and frames the gap between "learning to program" and "engineering software." Introduces the editor landscape (shell editors, text editors, IDEs) and argues for a full-featured editor like VS Code.
- **Early (~10%–30%)**: Moves from tooling to environment. Explains containers vs. virtualization, then walks through Docker fundamentals (Dockerfile, image, container), basic command-line skills, and building/pushing your first image. Shifts into version control with Git and GitLab: repositories, commits, diffs, branches, merges, and conflict resolution.
- **Middle (~30%–50%)**: A hands-on Python fundamentals block delivered inside the Docker environment — variables and types, strings, lists and other collections, operator precedence, while loops and control flow, and function design (one function, one goal). This is the language substrate for everything that follows.
- **Late (~50%–70%)**: Object-oriented design: classes as encapsulation of behavior and attributes, constructors, magic methods and operator overloading, illustrated with small money/group examples. Builds the modeling vocabulary needed for larger systems.
- **Ending (~70%–100%)**: The engineering layer — testing and code quality (unit tests, integration tests, refactoring, peer reviews, walk-throughs, staging and UAT), then planning and design via the software development lifecycle and modelling. Closes the loop from "code that runs" to "software that ships."
【Key Takeaways】
- **Engineering is more than coding** (Opening): the book's central thesis is that tools, methodology, and process matter as much as syntax — the reason a beginner needs a guide, not just a language tutorial.
- **Containers replace environment wrangling** (Early): Dockerfile → image → container is the mental model; images are inert, containers are the running (or stopped) instances, and compose orchestrates multi-service setups. This solves the classic "works on my machine" problem.
- **Version control is a workflow, not a command list** (Early): commits are save points, diffs compare working state to the last commit, branches isolate work, and merges (including conflict resolution) are where collaboration actually happens. Force-pushing is flagged as dangerous.
- **Language fundamentals are taught in service of the environment** (Middle): variables, collections, operator precedence, and loops are demonstrated by editing files inside the Docker setup, so practice and tooling reinforce each other.
- **Functions should do exactly one thing** (Middle): the VAT example makes the case that combining summation and calculation hurts readability and invites bad practice — a small rule with large design consequences.
- **Classes encapsulate behavior and data** (Late): the dog and funds examples show attributes, constructors, and magic methods as the building blocks of modeling real-world concepts in code.
- **Testing and review are quality gates, not afterthoughts** (Ending): unit and integration tests, refactoring, peer review, walk-throughs, and staging/UAT form a layered defense — with honest acknowledgment of testing's downsides (time pressure, test validity).
- **Plan before you build** (Ending): the SDLC and modelling are presented as the frame that keeps a project from drifting, connecting design decisions back to the software crisis the book opens with.
【Reading Tips】
- **Deep-read the Docker and Git chapters** (Early): these are the highest-leverage skills and the ones most beginners skip; type every command rather than reading passively.
- **Skim the Python fundamentals if you already code** (Middle): use it as a checklist for gaps (operator precedence, loop control variables) rather than a full course.
- **Treat the OOP section as design practice** (Late): focus on why the funds class separates concerns, not on memorizing magic method syntax.
- **Read the testing and SDLC chapters even if they feel abstract** (Ending): they explain the "why" behind practices you'll meet in any professional team.
- **Keep the environment running alongside the book**: the author deliberately builds examples inside the container, so following along in your own setup is the intended mode.
【Coverage Limits】
The excerpts cover the book's structure and early-to-middle content in detail but thin out toward the final chapters; specific code listings, chapter numbering beyond the table of contents, and the full depth of the testing and SDLC material are only partially represented here.
Passage locations
Page 6
ss of which company you work for. If you consider a company with 200 employees and a 1,000,000 clients, and compare it to a company with 2 employees and 150...
View in text
Excerpt 2
m an image and prepares it for running but does not run it. docker run creates the container from an image and runs it. After running either of these command...
View in text
Excerpt 3
e used with integers and the result will be a loat. Boolean Boolean values can either be True or False. In Python, True and False are always capitalized. The...
View in text
Excerpt 4
o your function to do operations on, you pass it in via the parameter list. The keyword def is the statement declaring a function that follows it. The functi...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
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