Testing and maintenance
도입됨
19:05
프로그래밍 개발 수명 주기
아주 작은 버그라도 출시될 때까지 발견되지 않으면 수정하는 데 큰 비용이 들 수 있습니다. 일찍 발견할 때보다 훨씬 더 많이 듭니다. 그래서 우리는 바로 코드를 입력하기 시작하지 않습니다. 우리는 …을 따릅니다
영어 내레이션 · 영어와 중국어 자막 전환 가능
이 수업의 내용
| English | 의미 |
|---|---|
| code/kəʊd/ | Instructions written in a programming language for a computer to follow. |
| 16-bit integer | A whole number stored using 16 binary digits. |
| conversion/kənˈvɜːʃn/ | The process of changing a value from one data type to another. |
| overflowed | Describes a value that was outside the range its storage could represent. |
| run-time error/rʌn taɪm ˈerə/ | 실행 중 오류 |
| routine/ruːˈtiːn/ | A set of instructions that performs a particular task within a program. |
| test data/test ˈdeɪtə/ | Data chosen to check whether a program works as expected. |
| testing/ˈtestɪŋ/ | Running a program with chosen inputs to check that it gives the expected outputs. |
| syntax error/ˈsɪntæks ˈerə/ | 문법 오류 |
| keyword/ˈkiːwɜːd/ | A word with a fixed meaning in a programming language or pseudocode. |
| translation/trænˈsleɪʃn/ | Expressing the meaning of a message or text in another language. |
| array index | A whole number that identifies the position of an item in an array. |
| exception/ekˈsepʃn/ | An event that signals an error or unusual condition while a program runs. |
| logic error/ˈlɒdʒɪk ˈerə/ | logic error: 논리 오류 |
| loop/luːp/ | A structure that repeats a sequence of instructions. |
| conditions/kənˈdɪʃnz/ | A requirement or circumstance that affects what happens or whether something is true. |
| tracing/ˈtreɪsɪŋ/ | The process of following a program step by step and recording variable values. |
| translator/trænˈsleɪtə/ | A program that changes code into a form a computer can execute. |
| dry run/draɪ rʌn/ | dry run: 수동 추적 |
| variable/ˈveərɪəbl/ | A quantity or named value that can change or take different values. |
| trace table/treɪs ˈteɪbl/ | A table recording variable values and outputs as an algorithm's steps are followed. |
| walkthrough/ˈwɔːkθruː/ | |
| White-box testing/waɪt bɒks ˈtestɪŋ/ | Testing that uses the internal structure of code to design tests. |
| statement/ˈsteɪtmənt/ | A line of code that tells a program what to do. |
| branch/bræntʃ/ | A path of instructions chosen according to a condition or value. |
| Black-box testing/blæk bɒks ˈtestɪŋ/ | Testing that uses the specification to design tests without examining the code. |
| specification/ˌspesɪfɪˈkeɪʃn/ | A description of what a program must do and the requirements it must meet. |
| Integration testing/ˌɪntɪˈɡreɪʃn ˈtestɪŋ/ | Testing combined modules to check that they work together correctly. |
| modules/ˈmɒdjuːlz/ | Separately organised program components that perform defined tasks and communicate through interfaces. |
| interfaces | Points where modules connect and exchange data or commands. |
| stub/stʌb/ | 스텝(stub) |
| alpha testing/ˈælfə ˈtestɪŋ/ | 알파 테스트 |
| beta testing/ˈbiːtə ˈtestɪŋ/ | 베타 테스트 |
| Acceptance testing/əkˈseptəns ˈtestɪŋ/ | Testing by the customer against requirements to decide whether a product is suitable. |
| test strategy/test ˈstrætədʒi/ | 테스트 전략 |
| test plan/test plæn/ | 테스트 계획 |
| expected output/ekˈspektɪd ˈaʊtpʊt/ | The result a test should produce if the program works correctly. |
| actual output | The result a program produces when a test is run. |
| expected result | |
| Normal data/ˈnɔːml ˈdeɪtə/ | Typical valid values inside the range, which should be accepted and processed correctly. |
| Abnormal data/əbˈnɔːml ˈdeɪtə/ | Values that should be rejected, out of range or the wrong type. |
| Extreme data/ekˈstriːm ˈdeɪtə/ | The smallest and largest values that a program should accept. |
| Boundary data/ˈbaʊndəri ˈdeɪtə/ | Values at and just outside the edges of the accepted range. |
| Corrective maintenance/kəˈrektɪv ˈmeɪntənəns/ | The process of fixing faults found in software after release. |
| Adaptive maintenance/əˈdæptɪv ˈmeɪntənəns/ | The process of changing software to keep it working in a changed environment. |
| operating system/ˈɒpəreɪtɪŋ ˈsɪstəm/ | System software that manages hardware resources and provides services for applications. |
| API/ˌeɪ piː ˈaɪ/ | A set of rules that allows one program to use another program's services. |
| Perfective maintenance/pəˈfektɪv ˈmeɪntənəns/ | The process of improving software that already works after its release. |
| algorithm/ˈælɡərɪθəm/ | A finite sequence of precise steps for solving a problem or carrying out a task. |
| data flow | The movement of data through the different parts of a program. |
| subroutine/ˈsʌbruːtiːn/ | A named set of instructions that performs a task when called. |
| caller/ˈkɔːlə/ | The program or module that asks another module to run. |
| parameter list | The ordered list of variables that receive values when a subroutine is called. |
| data structure/ˈdeɪtə ˈstrʌktʃə/ | A way of organising and storing data to support particular operations. |
| regression testing/rɪˈɡreʃn ˈtestɪŋ/ | 회귀 테스트 |
37초
- On 4 June 1996 the first Ariane 5 rocket lifted off from French Guiana. Thirty-seven seconds later it veered off course and destroyed itself. The payload was four satellites worth $370 million.
- 원인은 아리아네 4에서 재사용된 한 줄의 코드로, 64비트 수를 16비트 정수로 변환하는 것이었습니다. 아리아네 5는 더 빠르게 비행했으므로 해당 수치는 더 커졌고, 변환 과정에서 오버플로우가 발생했습니다: 이는 발사 후 더 이상 필요하지 않은 routine에서 발생한 **런타임 오류(run-time error)**였습니다.
- The code had never been tested with Ariane 5's flight data. Nobody had chosen test data at the extremes of the new rocket's range.
- 이 교훈은 세 가지 유형의 오류, 테스트 방법, 테스트 데이터 선택법, 그리고 배포 이후 프로그램을 유지 관리하는 방법을 다룹니다.

세 가지 유형의 오류
- 구문 오류는 언어의 문법 규칙을 위배하는 것으로, 괄호 누락이나 키워드 오타 등이 포함됩니다. 이 오류는 번역 단계에서 발견되므로 수정하기 전까지 프로그램은 실행되지 않습니다.
- 실행 중 오류는 프로그램이 실행되는 도중 발생합니다: 0으로 나누기, 존재하지 않는 파일, 배열 인덱스 범위 초과 등이 해당합니다. 프로그램이 종료되거나 예외를 발생시키며, 위험한 연산 전에 체크를 수행하여 수정할 수 있습니다.
- **논리 오류(logic error)**는 프로그램이 실행되어 **틀린 결과(wrong results)**를 생성하게 만듭니다:
+for-, off-by-one 루프, 조건문의 잘못된 순서 등. 이를 감지하는 신호가 없으며, 오직 테스트와 추적(tracing)을 통해만 밝혀집니다.

번역 단계에서 발견됨, 런타임에서 발견됨, 출력에서만 발견됨

Match each kind of error to how it shows up.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Syntax = caught at translation; logic = wrong output; run-time = crash while running.
worked example: 오류를 찾아 수정하기
Total ← 0
FOR i ← 1 TO Count
Total ← Total + Marks[i]
NEXT i
Average ← Total / Count
IF Average > 50 THEN
OUTPUT "Pass"
- 구문:
IF에ENDIF이 없습니다. 번역기가 이를 거부합니다. 런타임:Count가 0이면 나누기 연산이 실패하므로, 이를IF Count > 0 THEN으로 보호(guard)하십시오. 논리: 점수가 50점 이상이면, Exactly 50점에서 학생을 불합격(fail)시키는> 50대신,>= 50이어야 합니다. - 오류의 종류를 명시하고, 왜 그것이 해당 종류인지 설명하며, 수정 방법을 제시하십시오. 3가지 요소, 총 3점 배점입니다.
A program divides a total by the number of entries and crashes when the input file is empty. This is a:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Division by zero happens while the program runs and stops it. A guard such as IF Count > 0 fixes it.
테스트 방법: 코드 읽기
- **드라이 런(dry run)**은 종이에 코드를 추종(tracing)하여 각 행마다 trace table에 변수의 값을 기록합니다.
- 코드 리뷰는 팀 검토의 일종입니다. 프로그래머가 줄 단위로 코드를 설명하고 동료들이 결함을 찾습니다.
- **백박스 테스트(White-box testing)**는 코드의 내부 구조를 기반으로 테스트를 설계하여, 모든 문장, 분기, 루프를 실행하도록 합니다. **블랙박스 테스트(Black-box testing)**는 명세서(specification)만으로 테스트를 설계합니다: 입력을 공급하고, 출력을 예상된 것과 비교하며, 코드는 보지 않습니다.

바깥에서 안을 보는 것, 혹은 안에서 모든 경로를 보는 것

Designing test cases from the specification only (inputs and expected outputs), ignoring the code inside, is called ______-box testing.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Black-box tests from the spec; white-box uses the code's internal structure to cover statements and branches.
테스트 방법: 조립 및 배포
- **통합 테스트(Integration testing)**는 개별적으로 테스트된 모듈들을 결합하고 그 사이의 인터페이스를 테스트합니다. 아직 작성되지 않은 모듈을 대신하여 고정된 값을 반환하는 **스텝(stub)**을 사용하여 나머지 부분을 상하분해(top-down)로 테스트할 수 있습니다.
- 알파 테스트 α는 출시 전에 개발사 내부에서 수행됩니다. 베타 테스트 β는 제한된 실제 사용자 그룹에게 사용자의 환경에서 프로그램을 제공합니다.
- **수용 테스트(Acceptance testing)**는 고객에 의해 요구사항에 부합하는지 여부를 결정하기 위해 수행됩니다.
Software process lab
Classify development examples by the stage or tool they belong to.
worked example: 어떤 상황에 어떤 테스트 방법
- 보고 모듈은 완성되었으나 이를 호출하는 데이터베이스 모듈이 아직 없으면, 고정된 데이터를 반환하는 스텀을 사용하여 테스트해야 합니다.
- Two modules pass their own tests but fail when the output of one feeds the other: integration testing of the interface.
- 소프트웨어가 완성되었으므로, 일반 출시 전에 실제 환경에서 결함을 찾아야 합니다: 제한된 사용자 그룹에 의한 베타 테스트.
- 고객이 결제 여부를 결정합니다: 합의된 요구사항에 따른 수용 테스트. 이 방법의 이름과 목적을 명시하십시오.
Match each situation to the testing method it needs.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Stub for a missing part, beta for real users, acceptance for the customer, integration for the joins.
테스트 전략 및 테스트 계획
- 테스트 전략은 고수준 접근법입니다: 어떤 종류의 테스트를, 누가, 언제 수행하며, 다음 단계로 넘어가기 위해 무엇이 통과해야 하는지 정의합니다.
- 테스트 계획은 테스트의 상세 목록입니다. 각 항목마다 목적, 입력 데이터, 기대 출력, 그리고 테스트 실행 시 실제 출력을 기록할 열이 포함됩니다.
- 기대 결과가 없는 테스트는 테스트가 아닙니다. 프로그램이 무엇을 했는지 보여줄 뿐, 그것이 올바른지 여부는 확인하지 못합니다.
A test plan lists, for each test, the input data and the expected output.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Purpose, input, expected output and a column for the actual output. The strategy is the high-level approach; the plan is the detailed list.
테스트 데이터 선택
- 정상 데이터: 범위 내의 일반적인 유효 값으로, 허용되어야 하며 올바르게 처리되어야 합니다.
- 비정상 데이터: 거부되어야 할 값으로, 범위를 벗어났거나 유형이 틀린 경우입니다.
- 극한 데이터: 여전히 허용되는 가장 크고 작은 값으로, 범위의 가장자리 위치입니다. 경계 데이터: 각 가장자리를 가로지르는 쌍으로, 허용된 극한 값과 그 바로 바깥에 있는 거부된 값(한 자리 오류가 숨어있는 곳)을 의미합니다.

내부, 외부, 그리고 선 위에

For a field that accepts marks 0–100, which are the boundary test values?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Boundary data sits at the edges of the valid range (and just outside) — where off-by-one errors hide.
worked example: 0부터 100점까지의 점수를 위한 테스트 데이터
| 종류 | 데이터 | 기대 결과 |
|---|---|---|
| 정상 | 50, 75 |
수용되고 처리됨 |
| 비정상 | -10, 200, "abc" |
거부됨: 범위를 벗어남 또는 유형 오류 |
| 극한 | 0, 100 |
허용됨: 가장 작고 큰 유효 값 |
| 경계 | -1와 0, 100와 101 |
-1 거부됨, 0 허용됨; 100 허용됨, 101 거부됨 |
- 모든 행에는 기대 결과가 필요합니다. 입력만 나열한 표는 절반 점수만 받습니다. 극한 값은 허용됩니다:
-1는 경계 값이지 극한 값이 아닙니다.

A field accepts marks from 0 to 100. Which values are extreme test data? Select 모든 that apply.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Extreme values are the smallest and largest still accepted. -1 is rejected, so it is boundary or abnormal; 50 is normal.
유지보수
- 프로그램의 수명 기간 비용 대부분은 출시 후 발생합니다. 정적 유지보수는 사용 중 발견된 결함을 수정합니다.
- 적응형 유지보수는 변화하는 환경에서도 프로그램이 작동하도록 유지합니다: 새로운 운영체제, 새로운 API, 법규 변경 등.
- 완화적 유지보수는 이미 작동하는 프로그램을 개선합니다: 더 빠른 성능, 사용자가 요청한 새로운 기능 등. 프로그램은 수명 기간 동안 세 가지 모두를 필요로 할 수 있습니다.

수리하고, 작동하게 유지하며, 개선하다

Corrective maintenance fixes faults, perfective maintenance improves features, and adaptive maintenance keeps the software working in a changed environment.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Three maintenance types: corrective (fix bugs), perfective (enhance), adaptive (new OS/hardware/rules).
A payroll program is changed because the tax law changed. Which kind of maintenance is this?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The program was not faulty and is not being improved; its environment changed. That is adaptive maintenance.
기존 프로그램 수정
- 알고리즘과 데이터 흐름을 이해할 때까지 기존 코드를 읽으십시오. 수정이 필요한 곳을 찾으십시오: 어느 서브루틴, 어느 줄인지.
- 수정 사항을 최소로 유지하십시오; 작동 중인 코드를 다시 작성하지 마십시오. 관련 모든 부분을 업데이트하십시오: 변경된 매개변수 목록을 호출하는 각 지점, 변경된 데이터 구조를 사용하는 각 routine.
- 새로운 기능과 기존 기능을 모두 테스트해야 합니다: 회귀 테스트는 Previously 작동하던 기능이 깨지지 않았는지 확인합니다. 이후 변경 사항을 문서화합니다.
After changing a program, regression testing checks that:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Regression testing re-runs old tests to confirm existing behaviour still works after a change.
Put the steps of amending an existing program in order.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Understand, locate, change small, propagate, test everything, record. Skipping the regression test is how a fix breaks something else.
이 카드는 내용이 수정되어 번역이 업데이트될 때까지 영어로 표시됩니다.
Marks that slip away
- Extreme is accepted; abnormal is rejected.
0and100are extreme;-1and101are boundary values on the rejected side. - A logic error can produce wrong output or lead to a run-time error, such as an out-of-range array access.
- Alpha is in-house; beta is real users outside. A stub replaces a missing module; it is not a test method for finished code.
- A test plan row without an expected output 预期输出 earns nothing. Regression testing follows every change.
이해했습니다
- 구문 오류는 번역을 중단함 · 실행 시간 오류는 실행 중인 프로그램을 충돌시킴 · 논리 오류는 실행되어 잘못된 출력을 내며, 테스트를 통해만 발견됨
- 방법: 드라이 실행, 워크스루, 백색 박스(코드 기반), 흑색 박스(규격 기반), 통합(인터페이스, 누락된 모듈용 스터브 포함), 알파(사내), 베타(실제 사용자), 수용(고객)
- 테스트 데이터: 정상 허용, 비정상 거부, 극한 허용된 가장자리, 경계 각 가장자리 양쪽; 모든 테스트에는 기대 결과가 있음
- 유지보수: 정적 수정, 적응형 환경 대응, 완화적 개선; 소규모 수정, 호출자 업데이트, 회귀 테스트
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.