Program Design and Development
AP Computer Science Principles · Unit 1 — Creative Development
Development processes: iterative and incremental
A development process is the sequence of phases a team goes through to build a program. The usual phases are investigating and reflecting, designing, prototyping and testing. What makes a process good is not a fixed order but feedback: the results of one phase change the plan for the next.
The framework names two process styles, and the exam often asks you to identify which one a scenario describes.
- An iterative process requires refinement and revision based on feedback, testing or reflection throughout the process. The team goes around the cycle several times, and a later pass may send them back to an earlier phase — for example, user testing reveals confusion, so the team redesigns the screen that was already "finished".
- An incremental process breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole. The team builds the login feature, tests it until it is correct, then adds the search feature on top.
The two are not opposites. A real project is often incremental at the large scale (one feature at a time) and iterative inside each feature (several feedback loops per feature). A process can also be exploratory (the team discovers requirements while building) or ordered and intentional.
Investigation, specifications and documentation
Investigation answers the question what should this program do, and for whom? Teams collect information through surveys, user testing, interviews and direct observation of people doing the task. The outcome is a list of program requirements — descriptions of how the program must behave — and a program specification, which defines those requirements precisely enough that someone could test against them. A good requirement can be checked: "the reminder appears within one second of 8 p.m." can be tested, "the app is fast" cannot.
Design turns requirements into a plan: brainstorming, storyboarding the screens, deciding how to split the program into procedures and modules, laying out the user interface, and planning how the program will be tested.
Program documentation is a written description of the function of a code segment, event, procedure or program and how it was developed. Comments are one form of documentation written inside the code; they are ignored by the computer when the program runs, so they never change behaviour. Documentation helps in developing and maintaining a program, especially in a team, and it should be written throughout development, not only at the end. Comments that are not updated after a change become harmful: the program still runs the new way, but the comment now tells the next reader the old story.
Finally, code segments, media or ideas taken from others — a library, a tutorial, a classmate — must be acknowledged, normally by naming the author or source in the documentation.
Worked example: Nhận diện kiểu quy trình qua nhật ký dự án
A team's log for a library-booking app:
Week 1: interviewed 6 librarians; wrote the requirement “a student can reserve a study room for 1 or 2 hours.” Week 2: built and tested only the room-list screen. Week 3: added the reservation feature after the room list passed every test. Week 4: student testers could not find the cancel button, so the team moved it and re-tested. Week 5: testers asked for 30-minute slots; the team changed the requirement and the reservation code.
Which weeks show an incremental approach, which show an iterative approach, and what evidence in week 1 shows investigation?
Solution
Tăng dần: tuần 2–3. Nhóm làm và kiểm riêng màn hình danh sách phòng, chỉ thêm chức năng đặt phòng sau khi danh sách qua mọi ca kiểm. Đó đúng là “bảo đảm từng mảnh chạy đúng trước khi ghép”.
Lặp: tuần 4–5. Phản hồi của người thử kéo nhóm quay lại sửa thứ đã làm: tuần 4 sửa giao diện (vị trí nút huỷ) rồi kiểm lại; tuần 5 còn quay về tận giai đoạn yêu cầu, đổi “1 hoặc 2 giờ” thành khung 30 phút rồi sửa mã đặt phòng.
Khảo sát: tuần 1 có phỏng vấn 6 thủ thư và kết quả được ghi thành một yêu cầu kiểm được. Lưu ý: việc nhóm đổi yêu cầu ở tuần 5 không có nghĩa tuần 1 làm sai — quy trình lặp chính là chỗ cho phép điều đó.