📚 Year 13 CCEA Computer Science Case Study Practical Drill | Year 13 CCEA 计算机:案例分析实战演练
This practical drill walks you through a complete systems development life cycle (SDLC) case study for the CCEA A2 Computer Science specification. We will apply analysis, design, implementation, testing and evaluation to a school library book-lending system, building the skills you need for high marks in coursework and written papers.
本实战演练将带你完整走一遍符合 CCEA A2 计算机科学考纲的系统开发生命周期(SDLC)案例分析。我们将针对一个学校图书馆借阅系统依次实践分析、设计、实现、测试与评价,帮助你磨练课程作业与笔试取得高分所需的技能。
1. Case Study Introduction and Requirements Elicitation | 案例简介与需求获取
The school librarian currently uses paper records to track book loans, returns and member registration. This is error-prone and time-consuming. The school wants a digital library system that allows librarians to add new books, register members, record borrowings and returns, search for titles, and automatically calculate overdue fines at 10p per day.
学校图书管理员目前使用纸质记录追踪图书借阅、归还与会员登记,易出错且耗时。学校希望有一套数字化图书馆系统,能让管理员添加新书、注册会员、登记借还、搜索书名,并自动以每天 10 便士计算逾期罚款。
Stakeholders include the librarian, students, IT support staff and school management. We interviewed the librarian and observed daily workflows, producing the core functional requirements: manage books, manage members, process loans and returns, search catalogue, and generate overdue reports. Non-functional requirements include availability during school hours, response time under 2 seconds, and role-based access.
干系人包括图书管理员、学生、IT 支持人员和学校管理层。我们采访了图书管理员并观察日常工作流程,提炼出核心功能需求:管理图书、管理会员、处理借还、搜索书目、生成逾期报告。非功能需求包括上课时间可用、响应时间低于 2 秒和基于角色的访问控制。
2. Feasibility Study and Project Planning | 可行性研究与项目规划
Technical feasibility is high: the school already has a server and a well-maintained local network. The system will use a relational database (MySQL) and a web-based front-end built with HTML, CSS and Python Flask. Operational feasibility is positive because the librarian is comfortable with simple web forms. Economic feasibility shows an estimated development cost of £800 for a part-time developer over 4 months, which is within the school budget.
技术可行性高:学校已有服务器和维护良好的局域网。系统将使用关系数据库(MySQL)和基于 HTML、CSS、Python Flask 构建的 Web 前端。运营可行性强,因图书管理员熟悉简单的网页表单。经济可行性显示由兼职开发者历时 4 个月预计花费 800 英镑,在校方预算之内。
A Gantt chart was drawn up showing phases: requirements (2 weeks), design (3 weeks), prototyping (2 weeks), implementation (5 weeks), testing (3 weeks) and deployment (1 week). A contingency buffer of 2 weeks was added. The project manager will use iterative review meetings each Friday.
我们绘制了甘特图展示各阶段:需求(2 周)、设计(3 周)、原型(2 周)、实现(5 周)、测试(3 周)和部署(1 周)。还增加了 2 周缓冲。项目经理每周五举行迭代评审会议。
3. System Analysis: DFDs and Process Models | 系统分析:数据流图与过程模型
The context diagram (Level 0 DFD) shows the Library System as a single process receiving data flows ‘Book details’, ‘Member details’, ‘Loan request’ from the Librarian entity, and sending out ‘Loan confirmation’, ‘Overdue list’ and ‘Catalogue search result’. The Student entity interacts only when borrowing or returning books through the librarian.
背景图(0 级 DFD)将图书馆系统显示为一个单一处理,从管理员实体接收“图书详情”“会员详情”“借阅请求”数据流,并向外输出“借阅确认”“逾期清单”“书目搜索结果”。学生实体仅通过管理员借还书时参与交互。
When decomposed to Level 1, we identify process bubbles: 1. Register Book, 2. Register Member, 3. Borrow Book, 4. Return Book, 5. Calculate Fine, 6. Search Books, 7. Generate Overdue Report. Data stores include D1 Books, D2 Members, D3 Loans. The ‘Borrow Book’ process reads from Books and Members, and writes to Loans while decrementing CopiesAvailable.
分解到第 1 级时,我们识别出处理框:1. 登记图书、2. 登记会员、3. 借书、4. 还书、5. 计算罚款、6. 搜索图书、7. 生成逾期报告。数据存储包括 D1 Books、D2 Members、D3 Loans。“借书”处理会读取 Books 与 Members,并写入 Loans,同时减少 CopiesAvailable。
4. System Design: Database Design and Normalisation | 系统设计:数据库设计与规范化
Starting from an unnormalised form that repeats member details inside loan records, we apply normalisation. After 1NF (no repeating groups) we split into three tables. 2NF removes partial dependencies: Loans initially contains BookTitle which depends only on BookID, so it is extracted. 3NF removes transitive dependencies: MemberPhone only depends on MemberID, so it stays in Members. The final schema:
从借阅记录中重复会员详情的非规范化形式开始,我们进行规范化。经过 1NF(无重复组),分成三个表。2NF 去掉部分依赖:Loans 初始包含 BookTitle 仅依赖于 BookID,因此被提取。3NF 去除传递依赖:MemberPhone 仅依赖于 MemberID,故保留在 Members 表。最终模式:
| Table | Attributes | Primary Key |
|---|---|---|
| Books | BookID, Title, Author, ISBN, CopiesAvailable | BookID |
| Members | MemberID, FullName, Phone, Email, DateJoined | MemberID |
| Loans | LoanID, BookID (FK), MemberID (FK), DateBorrowed, DateDue, DateReturned, FinePaid | LoanID |
We enforced referential integrity via foreign keys. For fine calculation we use a derived attribute: Fine = (DateReturned – DateDue) * 0.10 if DateReturned > DateDue.
我们通过外键强制引用完整性。罚款计算使用派生属性:若 DateReturned > DateDue,则 Fine = (DateReturned – DateDue) × 0.10。
5. User Interface Design and Prototyping | 用户界面设计与原型
Low-fidelity wireframes were sketched on paper, then a horizontal prototype was built with HTML and Bootstrap for key screens: Login, Book Search, Borrow, Return, and Overdue Report. The search screen features a text box, a submit button and a results table. Librarians tested the clickable prototype and requested a ‘quick return’ button that prepopulates the last scanned member ID.
先在纸上绘制低保真线框图,然后用 HTML 和 Bootstrap 构建了关键页面的水平原型:登录、图书搜索、借书、还书和逾期报告。搜索界面包含一个文本框、提交按钮和结果表格。管理员测试了可点击原型,并要求增加一个可预填上次扫描会员 ID 的“快速归还”按钮。
The final design uses a consistent header with school logo, a sidebar navigation and clear feedback messages (e.g., ‘Book returned successfully. Fine due: £0.00’). Input validation is performed client-side with JavaScript and server-side, enforcing mandatory fields and date sanity checks.
最终设计采用带有校徽的统一页眉、侧边导航栏和清晰的反馈信息(如“图书归还成功,待缴罚款:£0.00”)。输入验证同时在客户端用 JavaScript 和服务器端进行,强制必填项和日期合理性检查。
6. System Architecture and Data Flow | 系统架构与数据流
The system follows a three-tier architecture: presentation layer (HTML/CSS/JS in browser), application logic layer (Python Flask handling routes, authentication and fine calculation) and data layer (MySQL database). Communication between tiers uses HTTP requests and SQL queries. This separation allows independent maintenance and testing.
系统采用三层架构:表示层(浏览器中的 HTML/CSS/JS)、应用逻辑层(Python Flask 处理路由、身份验证和罚款计算)和数据层(MySQL 数据库)。层间通信使用 HTTP 请求和 SQL 查询。这种分离允许独立维护和测试。
Session management tracks logged-in librarians and stores temporary member/book selections. The server validates all inputs to prevent SQL injection, using parameterised queries. Data flow diagrams from analysis are directly reflected in API routes: /api/borrow, /api/return, /api/search.
会话管理追踪已登录的管理员并存储临时的会员/图书选择。服务器端使用参数化查询验证所有输入以防止 SQL 注入。分析阶段的数据流图直接反映在 API 路由中:/api/borrow、/api/return、/api/search。
7. Implementation Using Pseudocode and SQL | 使用伪代码与 SQL 实现
A core module is the ‘Borrow Book’ function. Below is pseudocode describing the logic:
核心模块是“借书”功能。以下是描述逻辑的伪代码:
PROCEDURE BorrowBook(MemberID, BookID, Today)
IF Member NOT EXISTS OR MembershipExpired THEN RETURN ‘Invalid member’
IF BookID NOT EXISTS THEN RETURN ‘Book not found’
SELECT CopiesAvailable FROM Books WHERE BookID = BookID
IF CopiesAvailable < 1 THEN RETURN ‘No copies available’
SET DateDue = Today + 14 days
INSERT INTO Loans (BookID, MemberID, DateBorrowed, DateDue)
VALUES (BookID, MemberID, Today, DateDue)
UPDATE Books SET CopiesAvailable = CopiesAvailable – 1 WHERE BookID = BookID
RETURN ‘Loan recorded, due: ‘ + DateDue
END PROCEDURE
The corresponding SQL operation for search uses a parameterised query to avoid SQL injection:
对应的搜索 SQL 操作使用参数化查询以避免 SQL 注入:
SELECT BookID, Title, Author, CopiesAvailable FROM Books WHERE Title LIKE ‘%’ + ? + ‘%’;
Fine calculation is done in Python: if date_returned > date_due: fine = (date_returned - date_due).days * 0.10. The system updates the Loans table with FinePaid when the librarian records payment.
罚款计算在 Python 中完成:if date_returned > date_due: fine = (date_returned - date_due).days * 0.10。管理员记录付款时,系统更新 Loans 表的 FinePaid 字段。
8. Testing Strategies: Black Box and White Box | 测试策略:黑盒与白盒
Black box testing used decision tables for ‘Borrow Book’ covering combinations: valid/invalid member, available/zero copies, membership expired, already has 3 books out. Test cases were traced to requirements. For instance, Test B03: Valid member, book with 1 copy, loan succeeds, CopiesAvailable becomes 0.
黑盒测试采用决策表覆盖“借书”的各种组合:有效/无效会员、有/无可用副本、会员过期、已借出 3 本书。测试用例追溯到需求。例如测试 B03:有效会员、库存 1 本的图书,借阅成功,CopiesAvailable 变为 0。
White box testing targeted boundary values: loan period maximum 21 days with special permission; fine ceiling of £15; and the search function’s MySQL limit clause. Statement coverage was ensured by unit tests for the Flask route handlers. A test harness ran 45 automated tests nightly; all passed after 3 iterations.
白盒测试聚焦边界值:特殊许可下最大借阅期 21 天;罚款上限 15 英镑;以及搜索函数的 MySQL limit 子句。通过 Flask 路由处理器的单元测试确保语句覆盖。一个测试工具每晚执行 45 项自动化测试;经过 3 轮迭代后全部通过。
9. System Maintenance and Evaluation | 系统维护与评估
After deployment, the school reported that overdue notifications via email would be beneficial, so adaptive maintenance is planned. A feedback log is maintained; the first patch added a ‘renew’ feature. Perfective maintenance improved the search algorithm to use full-text indexing for faster results.
部署后,学校反馈若能通过邮件发送逾期通知将更有用,因此计划适应性维护。维护反馈日志;第一个补丁增加了“续借”功能。完善性维护改进了搜索算法,使用全文索引以更快返回结果。
Evaluation against original objectives: all functional requirements were met, average response time was 1.2s, librarian training took two hours, and overdue fines are now collected 95% faster. A user satisfaction survey scored 4.6 out of 5. However, the system does not yet support mobile devices, which is a limitation for the future.
对照原目标评价:所有功能需求已满足,平均响应时间 1.2 秒,管理员培训只花了 2 小时,逾期罚款收缴速度提高了 95%。用户满意度调查得分为 4.6/5。不过系统暂不支持移动设备,这是未来需改进之处。
10. Ethics, Security and Legal Issues | 道德、安全与法律问题
Member data (name, phone, email) is personal data under the Data Protection Act 2018 and UK GDPR. We implemented role-based login, encrypted passwords using bcrypt, and SSL for data in transit. Data retention policies state that loan records are anonymised after two years. The fair processing notice informs members that data is used only for library operations.
根据《2018 年数据保护法》和英国 GDPR,会员数据(姓名、电话、电子邮件)属于个人数据。我们实施了基于角色的登录、使用 bcrypt 加密密码,并对传输中的数据采用 SSL。数据保留政策规定,借阅记录在两年后匿名化。公平处理声明告知会员数据仅用于图书馆运营。
Ethically, the fines system must be transparent: a visual breakdown of fine calculation is displayed before payment. Access logs are reviewed weekly to detect unauthorised access. The librarian cannot view student fines if that student has a confidentiality flag. We documented a disaster recovery plan with nightly off-site backups.
在道德层面,罚款系统必须透明:付款前会显示罚款计算的明细。每周检查访问日志以发现未经授权的访问。若学生持有保密标志,管理员将无法查看其罚款。我们记录了灾难恢复计划,并设有夜间异地备份。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导