MGU Computer Science Series — Computer Science Foundations
Part IV: Computer Systems
Software · Libraries · APIs · IDEs · Git · Open Source
Chapter 17 of 28
MGU Computer Science Series  ·  Computer Science Foundations  ·  Library Textbook Edition

Chapter 17:
Software, Applications,
and Development Tools

What software is, how it is built, and the tools developers use every day — applications, libraries, frameworks, APIs, editors, terminals, packages, version control, and open source

■ Part IV: Computer Systems ■

■ 10 Sections  •  Chapter 17 of 28 ■

Follows Chapter 16: Operating Systems  ·  Prepares for Chapter 18: Databases and Information Systems

Purpose and Overview

"The best programs are written so that computing machines can perform them quickly and so that human beings can understand them clearly."

— Donald Knuth

Every day, people use software without thinking much about what software actually is, where it comes from, who builds it, or what tools its creators use. A student opens a web browser. An office worker launches a spreadsheet. A musician records tracks in a digital audio workstation. A scientist runs a data analysis script. All of these people are using software — but very few of them have thought carefully about what software is, how it is organized, and what the process of creating it looks like from the inside.

Chapter 17 answers those questions. In Chapter 16, you learned that an operating system manages hardware and creates a stable environment for programs to run. In this chapter, you will learn what runs inside that environment — applications, utilities, libraries, and frameworks — and how the people who build software do their work. You will explore the tools developers use every day: code editors, integrated development environments, terminals, package managers, and version control systems.

By the end of this chapter, you should understand the software ecosystem not just as a user but as someone who can read about it, discuss it, and begin to work within it. Whether you plan to become a developer, a data scientist, a systems administrator, or simply a more informed citizen of a software-driven world, the ideas in this chapter will serve you.

Opening Question

When a developer wants to build an app that shows nearby restaurants on a map, do they build their own mapping system from scratch? Do they write their own payment processing code? Do they design their own database engine? The answer to each question is almost certainly no. Modern software development is built on layers: libraries that provide reusable code, APIs that allow programs to communicate with specialized services, frameworks that provide a structure for building applications, and tools that manage all of it. Understanding these layers helps you understand how software actually gets built — and why the ecosystem of existing code that surrounds any new project is as important as the project itself.

10Sections
10Objectives
22Key Terms
8+Worked Examples

Learning Objectives

  1. 1Define software and describe the software stack as layers of programs depending on each other.
  2. 2Distinguish applications from utilities and classify software by category.
  3. 3Explain what libraries and frameworks are and describe how they differ from each other.
  4. 4Describe what an API is and explain how web APIs allow programs to communicate with services.
  5. 5Compare code editors with integrated development environments and identify the key features of each.
  6. 6Explain what a terminal is and describe why developers use command-line tools.
  7. 7Define packages and dependencies, and explain the risks that come with depending on external code.
  8. 8Explain what version control is and describe how Git uses commits, branches, and merges.
  9. 9Describe what open-source software is and explain why it matters to modern computing.
  10. 10Explain how software is installed and maintained, including the role of development, testing, and production environments.

Sections at a Glance

Sections 17.1 – 17.4
What Software Is and How It Is Organized
What Software Is · Applications · Libraries and Frameworks · APIs

What Software Is

When most people say "software," they mean the apps on their phone or the programs on their computer. That is a reasonable starting point, but software is broader than apps. Software is any set of instructions that a computing system can execute. Software tells the hardware what to do. Without software, a computer is an expensive collection of electronic components that does nothing at all.

Software takes many forms. The application you use to browse the web is software. So is the operating system managing your files and memory in the background. The compiler that transforms source code into machine instructions is software. The database engine storing millions of records is software. The firmware embedded in a car's brake system is software. The algorithm running on a remote server that decides which video to recommend to you next is software. All of these differ in what they do, who uses them, and how they are built — but they share the same fundamental nature: they are instructions that a machine follows.

The Software Stack

A useful mental model is the software stack — the layers of software that sit on top of hardware and on top of each other. Each layer depends on the layer below it and provides services to the layer above it.

┌──────────────────────────────────────────────────────┐ │ User Applications │ ← What users directly interact with ├──────────────────────────────────────────────────────┤ │ Application Frameworks and APIs │ ← Tools applications are built with ├──────────────────────────────────────────────────────┤ │ Libraries and Runtimes │ ← Reusable code modules ├──────────────────────────────────────────────────────┤ │ Operating System │ ← Manages hardware and resources ├──────────────────────────────────────────────────────┤ │ Hardware │ ← Physical components └──────────────────────────────────────────────────────┘

When you click a button in an app, that click triggers a chain of activity passing through multiple layers before anything changes in hardware. The application sends a request to a library. The library makes a call through the operating system. The operating system communicates with a hardware driver. The driver instructs a physical component. The result travels back up the same chain. This layered organization is one of the central ideas of computer systems — and it is the same principle of abstraction that you encountered in Chapter 13.

Study Note — Layers and Abstraction

Each layer hides the complexity of the layers below it. An application developer does not need to know how the operating system manages memory; the operating system does not need to know how the CPU executes an instruction. This controlled hiding of detail is what makes large, complex software systems manageable to build.

Applications and Utilities

An application — often called an "app" — is software designed for a particular task that a user wants to accomplish. Applications sit at the top of the software stack and are the most visible kind of software to most people.

CategoryPurposeExamples
ProductivityCreate, edit, and manage workWord processors, spreadsheets, project management tools
CommunicationSend messages, hold calls, share filesEmail clients, chat apps, video conferencing
EntertainmentGames, media, streamingGames, music players, streaming services
CreativeDesign and produce mediaImage editors, video editors, audio workstations
EducationalLearning and referenceLanguage apps, simulations, encyclopedias
BusinessManage operations and customersAccounting software, inventory systems, CRM tools
ScientificResearch and analysisSimulation tools, statistical packages, CAD software

Utilities

A utility is a small program that performs a specific support task rather than a user-facing creative or productive task. Utilities are often used by system administrators, developers, or power users who need to maintain, configure, or analyze a computing environment. Common utilities include file compression tools, disk space analyzers, system monitors showing CPU or memory usage, text editors for configuration files, antivirus scanners, backup tools, and disk repair programs.

The distinction between an application and a utility is not always perfectly sharp — a text editor might count as either, depending on how it is used. What matters is the underlying idea: some software is designed for end users doing productive work, and some software is designed to support, configure, and maintain the computing environment itself.

Libraries and Frameworks

Libraries

When developers write software, they do not start from nothing. Most real programs rely heavily on libraries — pre-written collections of code that solve common problems. A library is a collection of functions, classes, or modules that a program can import and call to perform specific tasks. Instead of writing everything from scratch, a developer imports a library and uses the functions it provides.

Consider what it would take to write a Python program that reads a spreadsheet, calculates some statistics, and draws a chart without any libraries. You would need to write code to parse the spreadsheet file format byte by byte, implement your own statistical formulas, and draw pixels to the screen. That could take months of work. With libraries, the same task becomes a few lines of code:

import pandas as pd # A library for reading and processing data tables import matplotlib.pyplot as plt # A library for drawing charts data = pd.read_csv("sales.csv") # Read a spreadsheet file print(data.describe()) # Calculate descriptive statistics data["revenue"].plot() # Draw a line chart plt.show() # Display the chart

Three lines of meaningful work, made possible by libraries that represent years of engineering effort by other people. Libraries exist for almost every area of computing.

TaskCommon Library Examples
Data processingpandas, NumPy
Web requestsrequests, httpx
Image processingPillow, OpenCV
Machine learningscikit-learn, TensorFlow
Working with datesdatetime, dateutil
Cryptographycryptography, hashlib
Testingunittest, pytest

Frameworks

A framework is larger and more opinionated than a library. While a library gives you tools to use as you choose, a framework gives you a structure within which you build your program. The key difference is who calls whom: when you use a library, your code calls the library's functions. In a framework, the framework calls your code at defined points. You fill in the parts specific to your application; the framework handles everything else.

Library vs. Framework

A library is like a toolbox. You pick up the tools you need and use them in your own way, on your own schedule.

A framework is like a building structure. The frame is already in place; you fill in the walls, rooms, and furnishings according to the framework's rules and expectations.

Web frameworks like Django and Flask (Python), Express (JavaScript), or Ruby on Rails provide a structure for building web applications. They handle the mechanics of receiving web requests, routing them to the right code, formatting responses, and managing database connections — so developers can focus on what their specific application does, rather than rebuilding those mechanics from scratch for every project. Testing frameworks like pytest or JUnit provide a structure for writing and running tests. Game frameworks provide a structure for building interactive graphical programs.

Understanding libraries and frameworks helps explain why software development is faster than it used to be, why a bug in a widely-used library can affect thousands of programs simultaneously, and why evaluating whether to trust and depend on a particular library is an important professional skill.

APIs at an Introductory Level

What an API Is

An API — Application Programming Interface — is a defined set of rules for how one piece of software can communicate with another. An API specifies what requests can be made, what format those requests should take, and what responses to expect back.

The word "interface" is the key. An interface is a defined point of contact between two things. An electrical outlet is an interface: it has a defined shape and voltage, so any compatible plug can use it without knowing anything about the wiring inside the wall. Similarly, an API defines how software can connect to a service without needing to understand how that service works internally.

Example 17.4.1
A weather app using an API
  • SituationA weather app on your phone shows the current temperature. The app did not build its own weather sensors. Instead, it communicates with a weather service through that service's API.
  • RequestApp → "Give me the current weather for Seattle, WA" → Weather Service API
  • ResponseWeather Service → "58°F, cloudy, 40% chance of rain" → App
  • Key IdeaThe app developer does not need to know how the weather service collects or processes weather data. They only need to follow the API's rules for making requests and reading responses.
The API is the contract between the two programs: this is how you ask, and this is what you will receive.

Web APIs and JSON

Most APIs you will encounter in modern programming are web APIs — they work over the internet using the same HTTP protocol used by web browsers. A program sends a request to a URL (called an API endpoint), and the service sends back data in a structured format called JSON.

JSON (JavaScript Object Notation) is a common text format for structuring data in API responses. It is human-readable and straightforward to parse in most programming languages:

{ "city": "Seattle", "temperature_f": 58, "condition": "Cloudy", "precipitation_chance": 40 }

APIs make it possible to build complex software by combining specialized services. A ride-sharing app might use a maps API for route calculation, a payments API for processing fares, a messaging API for driver notifications, and a location API for position tracking — rather than building any of those capabilities from scratch. This approach of assembling capabilities from APIs is sometimes called composing services.

Why APIs Matter Beyond Development

Understanding APIs helps explain why apps can share data across platforms, why changing one service can break multiple apps that rely on it, why API security matters enormously (APIs are where different systems share data), and why pricing changes at major APIs can affect entire ecosystems of apps overnight.

Practice 17.1–17.4Concept Check
  1. In the software stack diagram, what layer sits directly below the operating system? What does that layer provide to the operating system?
  2. A developer is building a mobile app that needs to process payments. Should they write their own payment processing code, or use a payments API? Give two reasons for your answer.
  3. Explain the difference between a library and a framework in your own words. Give one example of each type.
  4. A developer imports a library called requests into their Python program. Where does this library come from, and what problem does importing it solve?
  5. A web API returns this JSON: {"user": "alice", "score": 92, "level": "advanced"}. What three pieces of information are in the response?
  6. Classify each of the following as an application or a utility: (a) a video game, (b) a disk space analyzer, (c) a word processor, (d) a file compression tool, (e) a streaming music service.
Sections 17.5 – 17.7
The Tools Developers Use
Code Editors and IDEs · Terminals · Packages and Dependencies

Code Editors and IDEs

Writing software requires tools. The most fundamental is something to write code in. Because code is plain text, any text editor can technically be used — but tools designed specifically for code offer features that make the work significantly faster, more accurate, and less error-prone.

Code Editors

A code editor is a text editor built for writing and reading code. It offers features that general word processors like Microsoft Word do not. The most visible feature is syntax highlighting, which colors different parts of code differently based on what they mean — keywords appear in one color, strings in another, numbers in another, and comments in yet another. This makes code dramatically easier to read at a glance.

# Python code with syntax highlighting concepts illustrated: def greet(name): # keyword: def message = "Hello, " + name # string in quotes return message # keyword: return result = greet("Amara") # function call print(result) # built-in function

Other key features of code editors include auto-indentation (new lines are automatically indented to match the surrounding code structure, which matters especially in Python where indentation carries meaning), line numbers (letting developers refer to specific locations when discussing or debugging code), and search and replace (letting developers find and change patterns across large files or entire projects). Popular code editors include Visual Studio Code, Sublime Text, and Notepad++.

Integrated Development Environments (IDEs)

An IDE — Integrated Development Environment — combines a code editor with a comprehensive set of development features in a single application. The key word is "integrated": instead of switching between separate tools, the developer has everything in one place.

IDE FeatureWhat It Does
Code completionSuggests how to finish a function or variable name as you type, reducing typos and speeding up writing
Error highlightingUnderlines errors in code as you type, catching many syntax problems before the program is even run
Integrated debuggerLets you pause execution at any line, inspect variable values, and step through code one line at a time
Refactoring toolsRenames a variable or restructures code consistently across the entire project with one command
Built-in terminalIncludes a command-line panel so you never need to leave the IDE to run commands
Project managementOrganizes large collections of files and makes navigating a large codebase much easier
IDECommon Uses
Visual Studio CodeGeneral-purpose; Python, JavaScript, web development
PyCharmPython development
IntelliJ IDEAJava and JVM languages
EclipseJava, C/C++
XcodemacOS and iOS development
Android StudioAndroid app development
Choosing Between an Editor and an IDE

For a small script or quick edit, a lightweight editor is fast and sufficient. For a large project with many files, an IDE's navigation and debugging tools save significant time. Many developers use Visual Studio Code for most of their work because it falls between a plain editor and a full IDE — lightweight enough to open quickly, but extensible with plugins to add IDE-like features when needed.

Terminals and Command-Line Tools

A terminal — also called a command line, command prompt, shell, or console — is a text-based interface for interacting with an operating system. Instead of pointing and clicking, you type commands. The shell reads your command, executes it, and prints the result as text. The $ symbol is the prompt — the shell's signal that it is waiting for input.

$ ls Documents Downloads Pictures projects notes.txt $ cd projects $ ls web-app data-analysis scripts $ python my_script.py Hello, world!

Many essential developer tools have no graphical interface. They are designed to be used from a terminal. This is not a limitation — it is a deliberate choice with real advantages.

AdvantageExplanation
ScriptableCommands can be combined into scripts that run many steps automatically, enabling automation and repeatable workflows
Remote-friendlyYou can connect to a server anywhere in the world and run commands through a terminal connection, even without any graphical interface
ConsistentA text command behaves the same way regardless of screen size, operating system theme, or window arrangement
PreciseYou specify exactly what you want in explicit text rather than navigating menus and clicking through dialog boxes

Common Terminal Commands

CommandWhat It Does
ls / dirList files and folders in the current directory
cd foldernameChange the current directory to the named folder
pwdPrint the path of the current working directory
mkdir foldernameCreate a new directory with the given name
rm filenameDelete a file (permanently — no recycle bin)
cp source destCopy a file from one location to another
mv source destMove or rename a file
cat filenamePrint the contents of a file to the screen
python script.pyRun a Python script file
git statusShow the current state of a version-controlled project
Common Mistake — rm Is Permanent

Unlike moving a file to the recycle bin in a graphical interface, the rm command in a terminal permanently deletes a file immediately. There is no undo and no recycle bin. Beginners should be careful with this command, especially with options like -r (which deletes a directory and everything inside it).

Packages and Dependencies

What a Package Is

A package is a bundle of code — typically a library or tool — that has been packaged for easy downloading, installation, and use. Packages are the unit in which libraries are distributed. When a developer wants to use a library, they install it as a package using a package manager — a tool that handles downloading, installing, updating, and removing packages automatically.

$ pip install requests Collecting requests Downloading requests-2.31.0-py3-none-any.whl (62 kB) Installing collected packages: requests Successfully installed requests-2.31.0

After this, a Python program can use import requests to access the library's functions.

Language / EnvironmentPackage Manager
Pythonpip
JavaScript (Node.js)npm or yarn
Rubygem
JavaMaven or Gradle
Rustcargo
macOS system toolsHomebrew

Dependencies

A dependency is any library or package that your program relies on to function. If your program imports pandas, then pandas is a dependency. If pandas itself relies on NumPy internally, then NumPy is also a dependency of your project — an indirect (transitive) dependency. Most real software projects have dependency lists with dozens or even hundreds of packages, all of which must be installed for the software to work. Package managers handle this automatically.

Dependencies create efficiency — you get to build on other people's work — but they also create risk. A widely-used library with a security vulnerability makes every program that depends on it potentially vulnerable. Keeping dependencies updated is therefore a meaningful part of software maintenance, not a cosmetic concern. When a library is abandoned by its maintainers, programs depending on it may break as the world around them changes. In some cases, attackers have published malicious packages with names similar to popular libraries, hoping developers will accidentally install the wrong one — a type of attack called a supply chain attack.

Virtual Environments

When working on multiple Python projects, different projects may need different versions of the same library. A virtual environment is an isolated Python installation created for a single project, so each project can have exactly the dependencies it needs without conflicting with other projects on the same computer.

$ python -m venv my_project_env # Create a virtual environment $ source my_project_env/bin/activate # Activate it (macOS/Linux) $ pip install requests==2.28.0 # Install a specific version just for this project
Virtual Environments and Sandboxing

Virtual environments are a practical example of the broader computing idea of sandboxing — keeping different processes or environments separate so they cannot interfere with each other. The same principle applies in operating systems (processes cannot access each other's memory), in web browsers (one tab cannot read another's data), and in cloud computing (one customer's workload is isolated from another's).

Practice 17.5–17.7Skill and Concept Check
  1. Name three features an IDE provides that a basic text editor does not. For each feature, explain how it saves time or reduces errors.
  2. A developer wants to run a Python script from the terminal. Write the command they would type, assuming the script is called analyze.py.
  3. What is the difference between a direct dependency and an indirect (transitive) dependency? Give a concrete example of each.
  4. A developer's project depends on a library that has not been updated in three years and was just found to have a security vulnerability. What options does the developer have?
  5. Why are command-line tools easier to use for remote server management than graphical tools? Give two reasons.
  6. A student is working on two Python projects simultaneously: one needs version 1.5 of a library and the other needs version 2.1 of the same library. What tool addresses this problem, and how does it work?
Sections 17.8 – 17.10
Version Control, Open Source, and Maintaining Software
Version Control with Git · Open-Source Software · Installing and Maintaining Software

Version Control

The Problem Version Control Solves

Imagine working on a programming project over several weeks, making changes every day. Then you discover that something you changed two weeks ago broke a feature that was working fine before. Can you get the old version back? Without version control, the answer is probably no — unless you manually saved backup copies at every step. Even then, finding the right backup and understanding exactly what changed is difficult and unreliable.

Version control is a system that tracks changes to files over time. It records what changed, when it changed, and who changed it. It allows developers to view the complete history of a project, revert files or the entire project to any earlier state, see exactly what was different between any two points in time, work on new features without risking the stable version, and merge changes from multiple people working simultaneously.

Git

Git is by far the most widely used version control system today. It was created in 2005 and is now used by virtually every professional software team in the world. Git tracks changes in a repository (often called a "repo") — a directory where Git watches every file for changes.

Core Git Concepts

The Three Core Concepts of Git

Commit — A saved snapshot of the project at a particular moment, with a message describing what changed. Every commit has a unique identifier, a timestamp, the author's name, and a message.

Branch — A separate line of development. You can create a branch to build a new feature without affecting the main working version, then merge the branch back when the feature is ready.

Merge — The act of combining changes from one branch back into another, integrating completed work into the main codebase.

Example 17.8.1
Reading a Git commit record
  • What It IsA commit is Git's record of one set of changes. Every commit looks something like this:
  • Example commit 4a3f8e2 Author: Priya Sharma <[email protected]> Date: Mon Oct 14 14:32:17 2024 Add input validation to login form Users now see a clear error message if they enter an email address without an @ symbol.
  • Key PartsThe unique identifier (4a3f8e2), the author, the timestamp, and the message describing what changed and why.
The commit records who made this change, when, and why — creating a permanent, auditable history.

Branches and Merging

Main branch: A ── B ── C ── D (stable, working version) \ Feature branch: E ── F ── G (new feature in progress) \ After merge: A ── B ── C ── D ─────── H (feature merged in)

Branches allow parallel development. While one developer is building a new feature on a branch, the main branch stays stable. When the feature is complete and tested, the branch is merged back in. If the feature is abandoned, the branch is simply discarded without the main branch ever being affected. Most professional teams have conventions for branching: what the main branch represents, how long feature branches should live, and who reviews changes before they are merged.

A Simple Git Workflow

$ git init # Start tracking a directory as a Git repository $ git add main.py # Stage a file to include in the next commit $ git commit -m "Initial version" # Save a snapshot with a message $ git checkout -b add-search # Create and switch to a new branch # ... make changes to the code ... $ git add main.py $ git commit -m "Add search feature" $ git checkout main # Switch back to the main branch $ git merge add-search # Merge the feature branch into main
Version Control Is Not Just for Teams

Even individual developers working alone benefit enormously from version control. The complete recoverable history of a project, the ability to experiment on branches without risk, and the habit of writing commit messages that explain decisions are all valuable regardless of team size. Developing good version control habits from the start is one of the most impactful things a new developer can do.

Open-Source Software

What Open Source Means

Open-source software is software whose source code is publicly available. Anyone can read it, study it, use it, and — under certain license terms — modify and distribute it. This contrasts with proprietary software, where the source code is kept private by its owner. When you install proprietary software, you receive only the compiled, executable form; you cannot read or modify the underlying instructions.

Open-source software is remarkably central to modern computing. The Linux operating system — which powers most of the world's servers, Android phones, and supercomputers — is open source. The Python programming language and its standard library are open source. Most popular web servers, databases, machine learning frameworks, and development tools are open source. The infrastructure of the internet itself is largely built on open-source software.

BenefitExplanation
TransparencyAnyone can inspect the code to verify it does what it claims, check for hidden behavior, and identify security vulnerabilities
CollaborationDevelopers worldwide can contribute fixes, improvements, and features — creating a collective quality that no single company can match
CostOpen-source software is typically free to use, lowering barriers for students, researchers, small businesses, and developers everywhere
EducationReading real, production-quality code is one of the best ways to learn programming — open source makes this possible
LongevityProprietary software disappears when its company stops supporting it; open-source software can continue to be maintained by its community indefinitely

Open-Source Licenses

Not all open-source licenses are the same. A license specifies the rules for using, modifying, and distributing the software. Understanding licenses matters when building software professionally — using code without reading its license can create legal problems.

LicenseKey Rules
MIT LicenseVery permissive. Use, modify, and distribute for almost any purpose — including in proprietary products — as long as you include the license notice.
GNU GPL (General Public License)"Copyleft" license. If you distribute software that includes GPL code, you must also make your source code available under the GPL. Improvements must stay open.
Apache License 2.0Similar to MIT but includes explicit patent grants, providing additional legal protections.

Contributing to open-source projects is both a learning opportunity and a way to build a portfolio of real work. Contributing can mean reporting bugs, improving documentation, fixing known issues, or adding new features that the community has requested. For developers early in their careers, an open-source contribution provides concrete evidence of skills that no class grade can fully convey.

Installing and Maintaining Software

Installing Software

Software reaches users in several forms. App stores (on phones and increasingly on desktops) distribute software through curated catalogs that handle downloading, installation, and updates — and provide some degree of security review. Package managers like pip, Homebrew, or apt install software from the command line and are the standard approach for developer tools. Traditional installer files (such as .exe or .dmg) walk the user through an installation process that copies files to the right locations and configures the software. For open-source software, some developers download and compile the source code themselves — less common for end users, but normal in certain developer workflows.

Maintaining Software

Installing software is only the beginning. Maintenance is ongoing and necessary. Updates fix bugs, patch security vulnerabilities, and add features. Keeping software updated is one of the single most impactful things users and administrators can do for security. Dependency updates matter even when a program's own code has not changed, because vulnerabilities in dependencies affect every program that uses them. Monitoring means watching a running application for errors, slow performance, or unexpected behavior. When something goes wrong, logs — timestamped records of events — are typically the primary tool for diagnosing the problem.

Development, Testing, and Production Environments

Professional software teams typically run their software in multiple environments, each serving a distinct purpose.

EnvironmentPurposeWho Uses It
DevelopmentWhere new code is written and first tested; it is acceptable — expected — for things to break hereIndividual developers
Testing / StagingA separate system that closely mirrors the real deployment; new versions are tested here before reaching usersQA teams, developers
ProductionThe live system that real users interact with; changes here must be careful and controlledEnd users

This separation is a practical application of risk management: problems discovered in development or testing do not affect real users. Skipping this separation — pushing changes directly to production without testing — is a well-known source of major software failures.

Common Mistake — Skipping the Staging Environment

A common and costly mistake is making changes directly in the production environment without first testing in a staging environment. Even small changes can have unexpected effects. The staging environment exists precisely to catch these problems before they affect real users. Professional teams treat direct production changes without testing as a serious process failure.

Practice 17.8–17.10Concept and Application
  1. In your own words, explain why version control matters even for a developer working alone on a personal project.
  2. A developer creates a branch called fix-login-bug, makes three commits on it, and then merges it back into main. Draw a simple diagram of this process showing the branch diverging and then rejoining the main line.
  3. What is the difference between open-source software and proprietary software? Give one real example of each type.
  4. A developer is deciding whether to release their library under the MIT License or the GNU GPL. Describe one situation where MIT would be the better choice and one where GPL would be the better choice.
  5. A software company pushes a major update directly from development to production without using a staging environment. The update breaks the site for thousands of users. What went wrong in their process? What should they have done?
  6. Explain the purpose of a requirements.txt file in a Python project. Why is it important that it specifies exact version numbers rather than just package names?

Chapter Summary

Key Terms Review

software
Any set of instructions that a computing system can execute. Software tells hardware what to do.
software stack
The layered organization of software: user applications on top, then frameworks and APIs, then libraries and runtimes, then the operating system, then hardware below.
application
Software designed to help a user accomplish a specific task. Applications sit at the top of the software stack.
utility
A small program that performs a specific system support task rather than a user-facing productive task.
library
A collection of pre-written functions, classes, or modules that a program can import and call to accomplish specific tasks without building that functionality from scratch.
framework
A larger code structure that provides a template within which developers build specific applications. The framework calls the developer's code at defined points.
API
Application Programming Interface — a defined set of rules for how one piece of software can communicate with another.
JSON
JavaScript Object Notation — a common text format for structuring data exchanged through web APIs.
code editor
A text editor built for writing code, offering features like syntax highlighting, auto-indentation, and line numbers.
IDE
Integrated Development Environment — a tool combining a code editor with code completion, error highlighting, an integrated debugger, refactoring tools, and project management.
terminal
A text-based interface for interacting with an operating system by typing commands; also called a command line, shell, or console.
package
A bundle of code — typically a library or tool — distributed in a form that a package manager can download and install.
package manager
A tool that automates the downloading, installing, updating, and removing of software packages.
dependency
Any external library or package that a program relies on to function correctly.
virtual environment
An isolated Python installation for a single project, allowing different projects to have different dependency versions without conflict.
version control
A system that tracks changes to files over time, enabling developers to view history, revert to earlier states, and collaborate without overwriting each other's work.
Git
The most widely used version control system. It tracks changes in repositories using commits, branches, and merges.
commit
In Git, a saved snapshot of the project at a particular moment, accompanied by a message describing what changed.
branch
In Git, a separate line of development used to build features without affecting the stable main version.
open-source software
Software whose source code is publicly available for anyone to read, use, modify, and (under certain license terms) distribute.
proprietary software
Software whose source code is kept private by its owner; users receive only the executable form.
production environment
The live deployment of software that real users interact with, as distinguished from development and staging environments used for building and testing.

Software Stack Diagram Review

Study this diagram and answer the questions that follow.

┌──────────────────────────────────────────────────────┐ │ User Application │ │ (e.g., a web browser, a data analysis script, │ │ an inventory management system) │ ├──────────────────────────────────────────────────────┤ │ Frameworks and Imported Libraries │ │ (e.g., a web framework, a data library, │ │ a machine learning toolkit) │ ├──────────────────────────────────────────────────────┤ │ Language Runtime and Standard Library │ │ (e.g., Python interpreter, built-in functions) │ ├──────────────────────────────────────────────────────┤ │ Operating System │ │ (manages processes, memory, files, devices) │ ├──────────────────────────────────────────────────────┤ │ Hardware │ │ (CPU, memory, storage, network card, display) │ └──────────────────────────────────────────────────────┘
  1. At which layer does a user directly interact with software? Give one example from your daily life.
  2. A Python web application imports the Django framework. At which layer of this stack does Django sit?
  3. When a program calls a function to open and read a file, multiple layers are involved. Trace the path of that request from the application layer down to the hardware layer.
  4. If the operating system layer crashes or has a critical failure, what happens to all the layers above it? Explain why.
  5. A developer notices their application runs much faster on a newer computer. Which layer is primarily responsible for the performance difference? Why does this affect the application without any changes to the application's own code?
  6. A library the application depends on has a serious bug. Which layer must be updated to fix the problem? Does the user application code need to change? Explain.

Code Review

Fragment AUsing a Web API
import requests response = requests.get("https://api.openweathermap.org/data/2.5/weather?q=Seattle") data = response.json() print(data["main"]["temp"])
  1. What is requests? How does it arrive in a developer's project?
  2. What does requests.get(...) do? Which part of the software ecosystem does this interact with?
  3. The response comes back as JSON. What does .json() do to the response object?
  4. If the weather service's API changed the field name from "temp" to "temperature", what would happen when this code runs? What type of error is this?
  5. How would a developer discover that an API field name had changed, and what part of the code would need to be updated?
Fragment BA Requirements File
# requirements.txt requests==2.31.0 pandas==2.1.0 matplotlib==3.8.0
  1. What is a requirements.txt file used for?
  2. Why does the file specify exact version numbers (==2.31.0) rather than just listing the package name?
  3. A colleague tells you that requests version 2.31.0 has a security vulnerability. What should you do? Why does this vulnerability affect your program even though you did not write any requests code yourself?
  4. You are working on two separate projects: one needs pandas==1.5.0 and the other needs pandas==2.1.0. What tool prevents these from conflicting, and how does it work?

Concept Check

Answer these questions in your own words without referring to the chapter.

  1. What is the difference between a library and a framework? Give one example of each.
  2. What is an API, and why do modern applications rely on them so heavily?
  3. What is the purpose of a terminal? Why do developers use command-line tools when graphical interfaces exist?
  4. What does a package manager do? Name one package manager and the language or system it belongs to.
  5. What problem does version control solve? What would software development look like without it?
  6. What is a commit in Git, and what information does a commit record?
  7. What does "open source" mean? Give two reasons why open-source software matters to the computing world.
  8. What is the difference between a development environment and a production environment? Why does this distinction matter?

Practice Questions

Part ASimple Questions
  1. List three applications you use in daily life. For each, identify its category (productivity, communication, entertainment, creative, educational, business, or scientific).
  2. Name three features an IDE provides that a basic text editor does not. For each, explain how it reduces errors or speeds up work.
  3. What command would you type in a terminal to install the pandas package using pip?
  4. A developer creates a branch called fix-login-bug, makes three commits on it fixing a bug, and then merges it back into main. Draw a simple diagram of this process.
  5. Match each term with its best description: (a) Library, (b) API, (c) Package manager, (d) License, (e) Framework — Pre-written code a program imports; A defined communication interface between programs; Rules for using open-source code; A tool that downloads and installs code bundles; A structural template the developer's code fits into.
Part BModerate Questions
  1. A developer is building a mobile app that lets users find nearby restaurants. The app needs to show maps, process payments, and send text message confirmations. Describe how the developer might use APIs for each of these features. What is the advantage of this approach? What is one risk?
  2. Explain the difference between a direct dependency and a transitive (indirect) dependency. Give a concrete example. Why do indirect dependencies matter for security?
  3. You are working on a project and run git log and see three commits: "Add user profile page" (2 days ago), "Fix broken image links" (4 days ago), and "Initial commit" (1 week ago). You discover that the "Add user profile page" commit introduced a bug. Describe what version control allows you to do about this. What information in the log helps you?
  4. Compare open-source and proprietary software on four dimensions: cost, ability to inspect the code, community contributions, and support guarantees. Is one always better than the other? Explain why the answer depends on context.
  5. A developer writes a Python script that works perfectly on their own computer but fails on a colleague's computer with the error ModuleNotFoundError: No module named 'requests'. What is most likely wrong, and how can it be fixed?

Debugging and Error Analysis

Each situation below contains a mistake or misunderstanding. Identify the problem and explain what should have been done instead.

Situation 1 — Two Pythons, One Package Manager
Student installs pandas with pip but ModuleNotFoundError appears when running the script

A student installs a library using pip and then tries to import it in their script. The script fails with ModuleNotFoundError. They are confused because they definitely ran pip install. Later they discover they have two versions of Python on their computer, and pip installed the library for a different Python than the one running the script.

What went wrong? How do virtual environments prevent this kind of problem?

Situation 2 — Making Changes Directly on Main
Developer codes new feature directly on main branch and breaks stable code halfway through

A developer is adding a new feature and makes all their changes directly on the main branch instead of creating a feature branch. Halfway through, they realize the approach is not working and they want to go back to the version before they started. They have made 12 commits since then, mixed with earlier stable work.

How would this situation be different if they had used a branch? What options do they have now?

Situation 3 — API Key in Public Repository
API_KEY = "sk-a8f3b2c1..." written directly in source code, then pushed to public GitHub

A developer hardcodes a secret API key directly into their Python source code and then pushes the code to a public GitHub repository. Within hours, automated bots have scanned the repository, found the key, and used it to make thousands of dollars of API calls on the developer's account.

What serious mistake occurred? What should the developer have done to keep the key secret?

Situation 4 — Upgrading Python Directly in Production
Developer upgrades Python on the live production server without testing — app crashes for all users

A developer hears about a new Python version with useful features. Eager to use them, they upgrade Python directly on the production server that thousands of users depend on. After the upgrade, the application crashes. Error logs show that a key dependency is not compatible with the new Python version.

What went wrong in the process? Describe the correct process they should have followed using the three environments (development, staging, production).

Design and Application Questions

  1. You are building a command-line tool that helps students track their study sessions — recording subject, start time, end time, and notes. Describe: (a) what the tool's inputs and outputs are, (b) at least two libraries you would look for to help build it, and (c) how you would use Git to develop it safely.
  2. Design a requirements.txt file for a Python project that reads a CSV file, calculates statistics, draws a bar chart, and sends the results to a web API. You do not need real library names — describe what kind of library you need for each task, then pick a plausible name for each.
  3. A small team of three developers is starting a new software project. Design a version control workflow describing: (a) what the main branch represents, (b) how new features are developed, (c) when and how code is merged, and (d) what happens if two people's changes conflict.
  4. A company is deciding whether to use an existing open-source library or build the same functionality themselves. List three factors that would favor using the open-source library and three factors that would favor building it in-house.

Real-World Applications

  1. Behind the app. Choose a smartphone app you use often (a weather app, a maps app, a music app). Describe at least three APIs it is likely using. What service does each API provide? What would the app look like if those APIs did not exist and the developers had to build every capability from scratch?
  2. The open-source web. Many large websites publish information about what software powers them. Research one large site you visit (Wikipedia, for instance, publishes this information openly). Which components are open source? Are any proprietary?
  3. Version control in industry. In 2012, a deployment error at a large financial trading firm caused over $400 million in losses in less than an hour because an old version of trading software was accidentally deployed to production systems. How might proper use of version control, environment separation, and deployment review practices have reduced this risk?
  4. Dependency supply chains. In 2020, attackers compromised the build process of a major software company and inserted malicious code into a software update that was then automatically distributed to thousands of that company's customers, including government agencies. How does this attack relate to the concepts of dependencies, software supply chains, and the risks of trusting external code?
  5. Terminal in practice. Find a tutorial for a real developer tool (such as Git, pip, or a web framework) and identify at least five terminal commands it asks you to run. For each command, describe what it does in plain English without using technical jargon.

Mixed Review

These questions connect Chapter 17 to earlier chapters.

  1. From Chapter 16. When a developer opens a terminal and types python script.py, which component of the operating system is responsible for loading the Python interpreter into memory and starting it as a process?
  2. From Chapter 15. A developer runs their application on a computer with 4 GB of RAM. The program crashes with an "out of memory" error when processing a very large dataset. Which hardware component is the bottleneck, and what are the developer's options?
  3. From Chapter 14. A Python program reads a CSV file using a library and then filters for rows where a column called status equals "active". Express this filtering operation in plain English as a data processing step, using the vocabulary from Chapter 14's discussion of filtering and sorting data.
  4. From Chapter 13. An API returns data about the weather but only provides temperature, wind speed, and precipitation. A developer wants to know if conditions will feel uncomfortably humid. Why can't the API answer this directly? What does this reveal about the concept of abstraction and its limits that you studied in Chapter 13?
  5. From Chapter 12. A developer is building a search feature for a library catalog of 800,000 books. They need to decide between linear search and binary search. Which should they choose for performance reasons, and what condition must be met for the better-performing algorithm to work?

Chapter 17 Checkpoint

Chapter 17 Checkpoint
Complete without assistance — assesses vocabulary, concepts, and application from Chapter 17
Section 1 — Vocabulary and Definitions
  1. Define software and give three examples of software that are not applications on a phone or computer.
  2. Explain the difference between a library and a framework using the toolbox vs. building structure analogy. Give one example of each.
  3. What does API stand for, and what is the purpose of an API?
  4. What is version control, and what problem does it solve for individual developers?
  5. What does it mean for software to be open source? Name one benefit and one responsibility that comes with using open-source software.
Section 2 — Concepts and Comparison
  1. Describe three features an IDE provides that a basic text editor does not. For each feature, explain in one sentence how it helps a developer write better code.
  2. Explain why developers use the terminal even when graphical interfaces exist. Give two specific advantages of command-line tools.
  3. What is the difference between a direct dependency and a transitive dependency? Why do both matter for software security?
  4. A team is developing new software. Describe the purpose of each of the three environments: development, staging, and production. Why must changes flow through all three rather than going directly to production?
Section 3 — Scenarios and Application
  1. A developer writes code for a new feature directly on the main Git branch, makes 20 commits, and then realizes the feature is flawed and needs to be removed without disturbing the rest of the project's history. Why is this difficult? What should they have done instead?
  2. A popular open-source library used by thousands of programs is found to have a security vulnerability. Trace the chain of responsibility: who must act, what must they do, and in what order?
  3. A ride-sharing company's app uses three external APIs: a maps API, a payments API, and a messaging API. Describe one risk associated with depending on each of these external services. For each risk, describe one way the company might mitigate it.
Section 4 — Short Design Task
  1. You are starting a Python project to analyze data from a CSV file, generate a summary report, and email it automatically every Monday morning. (a) List three libraries you would need (by task, not necessarily by real name). (b) Describe how you would use Git to manage development safely. (c) Describe what your staging environment would look like for this project.
Looking Ahead
Chapter 18: Databases and Information Systems

Chapter 17 explained the software ecosystem: what software is, how it is built, and the tools developers use every day. Chapter 18 introduces a specialized but essential category of software: databases and information systems — the systems designed specifically to store, organize, retrieve, and protect large amounts of structured data. You have already encountered files and tables in Chapter 14. Chapter 18 goes deeper: it explains how relational databases organize data into tables with defined relationships, how queries allow powerful and flexible retrieval, how SQL (Structured Query Language) expresses those queries in a standardized form, and how database management systems ensure that data remains consistent, backed up, and reliable even under heavy use. You will also see how information systems — combinations of databases, applications, people, and processes — power the organizations that shape daily life: hospitals, banks, libraries, schools, governments, and the apps that connect them.

MGU Library Connection
  • Python Syntax Quick Reference — Appendix D of this textbook
  • Debugging and Testing Reference — Appendix E of this textbook
  • Computer Systems Reference — Appendix G of this textbook
  • Python Programming Foundations — full coverage of libraries, package management, and development tools
  • Web Development Foundations — frameworks, web APIs, and the full web development workflow
  • Cybersecurity Foundations — API security, dependency vulnerabilities, and supply chain attacks
  • MGU Dictionary entries: software, library, framework, API, IDE, terminal, package manager, version control, Git, open-source software