📚 Year 12 SQA Computing: Mock Unit Test Analysis | SQA 高一计算机:单元测试模拟卷解析
Unit tests are a cornerstone of the SQA Computing assessment at Year 12 level. This mock paper analysis walks you through a representative set of questions drawn from software development, computer systems, database design, and web development. Each section breaks down the question, explains the correct approach, and highlights common pitfalls to help you prepare with confidence.
单元测试是 SQA 计算机评估在 Year 12 阶段的核心。这份模拟卷解析将带你剖析一套涵盖软件开发、计算机系统、数据库设计和网页开发的代表性题目。每个小节都拆解问题、解读正确思路并指出常见陷阱,帮助你从容备考。
1. Software Development Methodologies | 软件开发方法论
A typical unit test question might ask you to identify the methodology that uses iterative cycles and continuous user feedback. The correct answer is Agile. In Agile, the project is broken into short time-boxed phases called sprints, each producing a working increment. This approach allows teams to adapt requirements based on client input and evolving needs.
典型的单元测试问题可能要求你识别使用迭代周期和持续用户反馈的方法论。正确答案是敏捷开发(Agile)。在敏捷中,项目被切分为称为冲刺的短时间盒,每次冲刺交付一个可工作的增量。这种方式让团队可以根据客户输入和变化的需求调整要求。
The Waterfall model, which is a common distractor, follows a strictly linear sequence: requirements, design, implementation, testing, and maintenance. There is no official loop back to earlier stages once a phase is completed, making it less flexible for changing specifications.
常见的干扰项是瀑布模型,它遵循严格的线性顺序:需求、设计、实现、测试和维护。一旦某个阶段完成,就不再有正式的回退循环,这使它难以应对需求变更。
When answering such questions, always link terms like ‘increments’, ‘stand-up meetings’, and ‘responding to change’ to Agile, and terms like ‘sequential’, ‘plan-driven’, and ‘phased hand-offs’ to Waterfall.
作答此类问题时,记得将“增量”、“站会”和“响应变化”与敏捷关联,而将“顺序执行”、“计划驱动”和“阶段性交接”与瀑布模型关联。
2. Data Representation – Binary and Hexadecimal | 数据表示:二进制与十六进制
Question example: Convert the binary number 1101 1010 into hexadecimal. SQA exams love testing this conversion because it ties into how data is stored. To solve it, split the binary into nibbles (4-bit groups): 1101 and 1010.
问题举例:将二进制数 1101 1010 转换为十六进制。SQA 考试喜欢测试这种转换,因为它关联到数据存储方式。解题时先将二进制拆成半字节(4位一组):1101 和 1010。
The nibble 1101 equals 8+4+0+1 = 13, which is D in hex. The nibble 1010 equals 8+0+2+0 = 10, which is A. So the answer is DA. Make sure you can quickly map 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F.
半字节 1101 等于 8+4+0+1 = 13,即十六进制的 D。半字节 1010 等于 8+0+2+0 = 10,即 A。所以答案是 DA。你必须能快速记住 1010=A、1011=B、1100=C、1101=D、1110=E、1111=F。
Another variation asks for the decimal value of a two’s complement binary number. If the most significant bit (MSB) is 1, the number is negative. Flip all bits and add 1 to find the magnitude, then prefix a minus sign.
另一种变体要求你找出一个二进制补码的十进制值。如果最高有效位(MSB)是 1,则该数为负数。将所有位取反后加 1 得到绝对值,然后加上负号。
3. CPU Components and the Von Neumann Architecture | 中央处理器组件与冯诺依曼架构
A question might ask: ‘Name the component within the CPU that performs arithmetic and logic operations.’ The answer is the Arithmetic Logic Unit (ALU). The CPU also contains the Control Unit (CU) which fetches, decodes, and manages execution, and registers such as the Program Counter (PC) and Memory Address Register (MAR).
问题可能会问:“请说出 CPU 中执行算术和逻辑运算的组件名称。”答案是算术逻辑单元(ALU)。CPU 还包含控制单元(CU),负责取指、解码和管理执行,以及寄存器,如程序计数器(PC)和内存地址寄存器(MAR)。
Understanding the fetch-decode-execute cycle is essential. In the fetch stage, the address in the PC is copied to the MAR, and the instruction at that address is loaded into the Memory Data Register (MDR). The PC then increments to point to the next instruction.
理解取指-解码-执行周期至关重要。在取指阶段,PC 中的地址被复制到 MAR,该地址处的指令被加载到内存数据寄存器(MDR)。然后 PC 自增指向下一条指令。
During the decode stage, the CU interprets the instruction fetched. During execute, the relevant processor components, such as the ALU, carry out the instruction, and results might be written back to memory or registers.
在解码阶段,CU 解读所取的指令。在执行阶段,相关处理器组件(如 ALU)执行该指令,结果可能被写回内存或寄存器。
4. Logic Gates and Truth Tables | 逻辑门与真值表
Here, you might be asked to complete a truth table for a simplified expression such as NOT (A AND B). First, recall the rules: AND outputs 1 only if both inputs are 1; NOT inverts the output.
这里你可能会被要求为简化表达式(如 NOT (A AND B))补全真值表。首先回顾规则:AND 仅在两个输入都为 1 时才输出 1;NOT 将输出取反。
Constructing this systematically prevents mistakes. The truth table below shows all combinations.
系统地构建真值表可以防止错误。下面的真值表展示了所有组合。
| A | B | A AND B | NOT (A AND B) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
In extended questions you might need to draw logic circuits using NOT, AND, OR gates. Practice translating Boolean equations into circuit diagrams: start from the innermost expression and work outward, connecting gates as needed.
在扩展题中,你可能需要画出使用 NOT、AND、OR 门的逻辑电路。练习将布尔方程转换成电路图:从最内层的表达式开始,向外绘制,按需连接门。
5. Programming and Pseudocode – Factorial Example | 编程与伪代码:阶乘案例
A regular question involves writing pseudocode to calculate the factorial of a number n and explaining why a recursive solution might cause a stack overflow. Factorial n! is the product of all positive integers up to n.
一个常见问题涉及编写伪代码计算数字 n 的阶乘,并解释为何递归解法可能导致堆栈溢出。阶乘 n! 是所有不大于 n 的正整数的乘积。
An iterative solution uses a loop. Its advantage is that it uses a constant amount of memory and avoids deep call stacks. However, recursion can be elegant but risky when n is large.
迭代解法使用循环。其优势在于使用常量的内存,避免深层调用栈。然而,递归虽优雅,但当 n 很大时存在风险。
Factorial(n)
If n <= 1
Return 1
Else
Return n * Factorial(n-1)
End If
A recursive factorial builds a stack frame for each call. When n is very large, the number of stacked frames exceeds the stack memory, causing a stack overflow error. The iterative version avoids this by not calling itself.
递归阶乘会为每次调用建立一个栈帧。当 n 非常大时,栈帧数量超出栈内存,导致堆栈溢出错误。迭代版本因为不调用自身,避免了这个问题。
6. Database Design and SQL Queries | 数据库设计与 SQL 查询
You could face a task like: ‘Write an SQL statement to display all students with a grade greater than 70, ordered by student name in descending order.’ The required query uses SELECT, FROM, WHERE, and ORDER BY.
你可能会遇到这样的任务:“编写一条 SQL 语句,显示所有成绩大于 70 的学生,并按学生姓名降序排列。”所需查询会用到 SELECT、FROM、WHERE 和 ORDER BY。
SELECT * FROM Student WHERE grade > 70 ORDER BY name DESC;
Make sure you never confuse the WHERE and HAVING clauses. WHERE filters rows before grouping; HAVING filters after aggregation. If the question asks to filter on an aggregate function like AVG, SUM, or COUNT, use HAVING.
请确保不混淆 WHERE 和 HAVING 子句。WHERE 在分组前过滤行;HAVING 在聚合后过滤。如果问题要求基于聚合函数(如 AVG、SUM 或 COUNT)进行过滤,则应使用 HAVING。
Entity relationship diagrams (ERDs) are also tested. Know the notations for one-to-many (1:M) and many-to-many (M:N) relationships, and be able to identify primary and foreign keys.
实体关系图(ERD)同样是考点。请熟悉一对多(1:M)和多对多(M:N)关系的表示法,并能够识别主键和外键。
7. Web Development – HTML and CSS | 网页开发:HTML 与 CSS
A standard unit test includes identifying the correct HTML tag for a hyperlink, which is <a href="url">. You may also be asked to write inline CSS to change the font color of a paragraph to blue.
标准的单元测试包括识别用于超链接的正确 HTML 标签,即 <a href="url">。你可能还会被要求编写内联 CSS,将段落的字体颜色改为蓝色。
The correct code would be: <p style="color:blue;">Text</p>. Remember that CSS properties follow the syntax property:value; and multiple declarations are separated by semicolons.
正确的代码是:<p style="color:blue;">Text</p>。记住 CSS 属性遵循 属性:值; 的语法,多个声明用分号分隔。
When combining selectors, an ID selector uses #, while a class selector uses a dot. For example, <p id="intro"> matches #intro { }, and <p class="highlight"> matches .highlight { }.
组合选择器时,ID 选择器使用 #,而类选择器使用点号。例如,<p id="intro"> 匹配 #intro { },<p class="highlight"> 匹配 .highlight { }。
8. Network Security – Encryption and Firewalls | 网络安全:加密与防火墙
Questions often distinguish between symmetric and asymmetric encryption. Symmetric encryption uses the same key for both encryption and decryption, making it fast but key distribution must be secure.
问题经常区分对称加密和非对称加密。对称加密使用同一密钥进行加密和解密,速度快,但密钥分发必须安全。
Asymmetric encryption uses a pair of keys: a public key for encryption and a private key for decryption. It solves the key distribution problem but is computationally slower. Hybrid systems combine both for efficiency.
非对称加密使用一对密钥:公钥用于加密,私钥用于解密。它解决了密钥分发问题,但计算速度较慢。混合系统结合两者以提高效率。
When asked about firewalls, describe them as hardware or software that monitors and controls incoming and outgoing network traffic based on predetermined security rules. A firewall creates a barrier between a trusted internal network and an untrusted external network like the internet.
当被问及防火墙时,应将其描述为根据预设安全规则监控和控制进出网络流量的硬件或软件。防火墙在受信任的内部网络和不受信任的外部网络(如互联网)之间建立屏障。
9. Algorithm Efficiency – Searching Techniques | 算法效率:搜索技术
You might need to compare linear search and binary search. Linear search scans each element sequentially; it works on unsorted lists but has O(n) time complexity in the worst case.
你可能需要比较线性搜索和二分搜索。线性搜索逐个元素顺序扫描;它适用于未排序的列表,但最坏情况下的时间复杂度为 O(n)。
Binary search repeatedly divides a sorted list in half, discarding the half that cannot contain the target. It achieves O(log n) time complexity, which is exponentially faster for large data sets.
二分搜索不断将已排序列表对半分割,抛弃不可能包含目标的那一半。它的时间复杂度为 O(log n),对大数据集而言呈指数级更快。
However, binary search requires the data to be sorted beforehand, which incurs an initial cost. Write the pseudocode clearly: set low to 0, high to length-1, compute mid, compare, and adjust low or high accordingly.
然而,二分搜索要求数据提前排序,这会带来初始成本。清晰写出伪代码:设置 low 为 0,high 为 length-1,计算 mid,进行比较,并相应地调整 low 或 high。
10. Legal and Ethical Issues – Data Protection | 法律与伦理问题:数据保护
A common question asks you to describe the purpose of the Data Protection Act 2018 (DPA). It governs how personal data is processed and used, ensuring that data is used fairly, lawfully, and transparently. The DPA incorporates the EU General Data Protection Regulation (GDPR) principles in UK law.
一个常见题目要求你描述《2018 年数据保护法》(DPA)的目的。它规范了个人数据的处理和使用方式,确保数据被公平、合法、透明地使用。该法案将欧盟《通用数据保护条例》(GDPR)的原则纳入英国法律。
Key principles include data minimisation (collect only what is necessary), purpose limitation, accuracy, storage limitation, and accountability. Individuals have rights to access their data, rectify inaccuracies, and request erasure under certain conditions.
关键原则包括数据最小化(只收集必要信息)、目的限制、准确性、存储限制和问责制。个人有权访问其数据、纠正不准确之处,并在特定条件下请求删除。
In a unit test, you may be given a scenario—such as a company sharing customer emails without consent—and asked to identify which principle is violated. The answer typically involves failing to process data lawfully or failing to obtain consent.
在单元测试中,可能会给出一个场景(如一家公司未经同意分享客户电子邮件),并要求你识别违反了哪项原则。答案通常涉及未能合法处理数据或未获取同意。
Published by TutorHao | Computing Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导