📚 WJEC Pre-U Computer Science: Case Study Practical Drills | 案例分析实战演练
In the WJEC Pre-U Computer Science examination, the case study component assesses your ability to analyse a realistic scenario and apply a wide range of theoretical knowledge. This article delivers a structured practical drill based on a University Library Management System. You will work through system analysis, design, data modelling, algorithm selection, testing, and evaluation, building the skills required for high marks.
在WJEC Pre-U计算机科学考试中,案例分析部分考察你分析真实场景并应用广泛理论知识的能力。本文以大学图书馆管理系统为背景,提供结构化实战演练。你将依次完成系统分析、设计、数据建模、算法选择、测试和评估,培养获取高分所需的技能。
1. Understanding the Case Study Scenario | 理解案例场景
The university currently uses a paper-based system for book loans, leading to misplaced records, duplicate reservations, and long processing times. The library management aims to develop a web-based system that automates circulation, enables online catalogue searches (OPAC), and manages member fines.
大学目前使用纸质系统管理图书借阅,导致记录丢失、重复预约和处理时间长。图书馆管理层计划开发一个基于Web的系统,实现流通自动化、在线目录检索(OPAC)和会员罚款管理。
Key functional requirements include borrowing, returning, reserving, renewing items, and generating overdue notices. Non-functional requirements demand a response time under 2 seconds for searches and 99.9% availability during term.
关键功能需求包括借书、还书、预约、续借和生成逾期通知。非功能需求要求搜索响应时间低于2秒,并在学期内提供99.9%的可用性。
The system must support 20,000 active members and a catalogue of over 500,000 titles. Scalability and data integrity are therefore critical design drivers.
系统必须支持20000名活跃会员和超过500000种图书的书目库。因此,可扩展性和数据完整性是关键设计驱动力。
2. Stakeholder Analysis | 利益相关者分析
Primary stakeholders are students and academic staff who need quick access to resources, and librarians who manage inventory and fine payments. Their needs often conflict: students want extended loan periods, whereas librarians prioritise resource circulation.
主要利益相关者是学生和教职员工,他们需要快速获取资源,以及管理库存和罚款的图书馆员。他们的需求常有冲突:学生希望延长借阅期,而馆员优先考虑资源流通。
Secondary stakeholders include the IT department responsible for system maintenance and the finance office that handles fine collection. The university management expects the system to reduce operational costs by 25%.
次要利益相关者包括负责系统维护的IT部门和处理罚款收集的财务处。大学管理层期望系统能将运营成本降低25%。
All stakeholders must be engaged through interviews and questionnaires to capture tacit knowledge and ensure the final system meets real workflow demands.
必须通过访谈和问卷让所有利益相关者参与进来,捕获隐性知识,确保最终系统满足真实工作流需求。
3. Requirements Elicitation | 需求获取
We conduct semi-structured interviews with senior librarians to uncover pain points in the manual process. Observation of the current loan desk reveals that 40% of staff time is spent manually updating overdue lists.
我们对高级馆员进行半结构化访谈,以发现手工流程中的痛点。对当前借阅柜台的观察显示,40%的员工时间花在手动更新逾期清单上。
A user questionnaire distributed to 500 students shows that 78% wish to receive automated email notifications for due dates. This feedback is documented as a functional requirement in the specification.
向500名学生发放的用户问卷显示,78%的学生希望收到到期日的自动电子邮件通知。此反馈已作为功能需求记录在规格说明书中。
Data protection regulations require that member records must be encrypted at rest. This non-functional constraint is recorded along with disaster recovery needs.
数据保护法规要求会员记录必须静态加密。这一非功能约束与灾难恢复需求一并记录。
4. System Modelling: Use Case Diagram | 系统建模:用例图
A use case diagram is created to visualise actors and their interactions. The primary actor ‘Member’ triggers use cases such as ‘Search Catalogue’, ‘Borrow Item’, and ‘Renew Loan’. The actor ‘Librarian’ handles ‘Manage Inventory’, ‘Process Fines’, and ‘Add New Member’.
创建用例图以可视化参与者及其交互。主要参与者“会员”触发“搜索目录”、“借阅项目”和“续借”等用例。参与者“图书馆员”处理“管理库存”、“处理罚款”和“添加新会员”等用例。
The ‘System Admin’ actor is responsible for ‘Configure System Parameters’ and ‘Manage Backups’. An ‘external Payment Gateway’ actor connects to ‘Process Online Fine Payment’.
“系统管理员”参与者负责“配置系统参数”和“管理备份”。一个外部“支付网关”参与者连接至“处理在线罚款支付”。
| Use Case | Actor(s) | Brief Description |
|---|---|---|
| Borrow Item | Member, Librarian | Checkout item, update loan record, generate due date |
| Reserve Item | Member | Place hold on currently unavailable book |
| Calculate Fine | System (automated) | Triggered daily to compute overdue charges |
用例表:借阅项目、预约项目、计算罚款。
5. Data Modelling: Entity-Relationship Diagram | 数据建模:实体关系图
We identify five core entities: Member, Book, Loan, Reservation, and Fine. A Member can have many Loans, but each Loan is associated with exactly one Member. A Book can be referenced in many Loans over time.
我们识别出五个核心实体:会员、图书、借阅、预约和罚款。一个会员可以有多次借阅,但每个借阅只对应一个会员。一本书可以随时间出现在多次借阅中。
To resolve the many-to-many relationship between Member and Book, we introduce the Loan entity as an associative table with attributes such as loanDate, dueDate, and returnDate. The Fine entity links to Loan with a foreign key.
为了解决会员和图书之间的多对多关系,我们引入借阅实体作为关联表,其属性包括借阅日期、到期日期和归还日期。罚款实体通过外键与借阅关联。
The Reservation entity holds positionInQueue and expiryDate. The ER model ensures that when a book is returned, the first reservation can be promoted to a loan, requiring careful transaction management to prevent race conditions.
预约实体包含排队位置和到期日期。ER模型确保当图书归还时,第一个预约可升级为借阅,这需要谨慎的事务管理以防止竞态条件。
6. Algorithm Design: Search and Sort | 算法设计:搜索与排序
For the OPAC search, the system must support title, author, and ISBN lookups. A linear search on unsorted records would take O(n) time. By maintaining an index on the title attribute using a balanced binary search tree, the search can be reduced to O(log n).
对于OPAC搜索,系统必须支持按书名、作者和ISBN查询。对未排序记录进行线性搜索需时O(n)。通过利用平衡二叉搜索树对书名属性建立索引,搜索可减至O(log n)。
When displaying search results, books should be sorted by relevance and then by publication year descending. We implement a merge sort with O(n log n) complexity because it is stable and performs well on large datasets.
显示搜索结果时,图书应先按相关度排序,再按出版年份降序排列。我们实现复杂度为O(n log n)的归并排序,因为它稳定且在大型数据集上表现良好。
A daily batch job checks all active loans and updates the fine table. The algorithm iterates through loans, comparing the current date with dueDate. If overdue, a fine is calculated as days × dailyRate, ensuring protection against integer overflow.
每日批处理作业检查所有活跃借阅并更新罚款表。算法遍历借阅记录,将当前日期与到期日期比较。若逾期,罚款按天数×日费率计算,确保防止整数溢出。
7. User Interface Design | 用户界面设计
The member dashboard is designed following Nielsen’s heuristics: consistency, error prevention, and visibility of system status. A prominent search bar sits at the top, with current loans, holds, and fines displayed as cards below.
会员仪表板遵循尼尔森启发式原则设计:一致性、错误预防和系统状态可见性。醒目的搜索栏位于顶部,当前借阅、预约和罚款以卡片形式显示在下方。
Accessibility is prioritised: colour contrast ratios meet WCAG AA, form labels are read by screen readers, and keyboard navigation is fully supported. During prototyping, we use wireframes to test three layout variants with real users.
优先考虑无障碍性:颜色对比度符合WCAG AA标准,表单标签可被屏幕阅读器读取,并完全支持键盘导航。在原型阶段,我们使用线框图让真实用户测试了三种布局变体。
The librarian interface provides a dashboard for inventory management with a barcode scanner integration, enabling fast check-in/check-out workflows and visual alerts for overdue items.
馆员界面提供一个带条码扫描器集成的库存管理仪表板,实现快速借还工作流,并为逾期项目提供视觉警报。
8. Database Normalisation | 数据库规范化
An initial denormalised loan table includes member name, book title, and fine amount. This suffers from update anomalies: if a member’s name changes, it must be updated in every loan record. We normalise up to third normal form (3NF).
初始的非规范化借阅表包含会员姓名、图书书名和罚款金额。这存在更新异常:若会员姓名变更,必须在每一借阅记录中更新。我们将其规范化至第三范式(3NF)。
| Before Normalisation | After 3NF |
|---|---|
| Loan(loanID, memberName, memberEmail, bookTitle, author, loanDate, dueDate, fineAmount) | Member(memberID, name, email) | Book(bookID, title, author) | Loan(loanID, memberID, bookID, loanDate, dueDate, returnDate) | Fine(fineID, loanID, amount, paid) |
规范化前后对比。After 3NF, no non-key attribute is transitively dependent on the primary key.
在3NF之后,没有非键属性传递依赖于主键,从而消除了冗余。
9. Testing Strategies | 测试策略
A comprehensive test plan covers unit, integration, system, and acceptance testing. Unit tests verify individual functions like calculateFine() return correct values for boundary dates. We use white-box testing to exercise all decision branches.
全面的测试计划涵盖单元测试、集成测试、系统测试和验收测试。单元测试验证个别函数(如calculateFine())对于边界日期返回正确值。我们使用白盒测试以覆盖所有决策分支。
Integration testing checks the interaction between the loan processing module and the notification service. We use a test stub for the email server, simulating sent overdue notices to avoid spamming real users.
集成测试检查借阅处理模块与通知服务之间的交互。我们使用电子邮件服务器的测试桩,模拟发送逾期通知,避免向真实用户发送垃圾邮件。
Acceptance testing involves librarians and students executing real scenarios: borrowing a book, returning it late, and paying the fine online. A test log documents passed/failed criteria, and defects are tracked via a ticketing system.
验收测试让图书馆员和学生执行真实场景:借书、逾期还书和在线支付罚款。测试日志记录通过/失败标准,缺陷通过工单系统跟踪。
10. Evaluation and Future Development | 评估与未来发展
Post-implementation, the system achieved a 60% reduction in checkout time and user satisfaction scores rose to 4.2/5. However, the initial version lacks a mobile app, which is a requested feature in user feedback.
实施后,系统使借出办理时间缩短了60%,用户满意度评分升至4.2/5。但是,初始版本缺乏移动应用,这是用户反馈中要求的功能。
Future iterations could incorporate a recommendation engine using collaborative filtering, RFID tag integration for self-service kiosks, and cloud hosting for elastic scalability during exam periods.
未来迭代可加入使用协同过滤的推荐引擎、用于自助服务亭的RFID标签集成,以及考试期间弹性扩展的云托管。
Maintenance must address technical debt: refactoring legacy authentication code and implementing automated regression testing to sustain system reliability.
维护必须解决技术债务:重构遗留身份验证代码并实施自动化回归测试,以维持系统可靠性。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导