일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- BOJ1655
- 코테
- 웹개발기초
- 확인문제
- 합성곱연산
- 냅색알고리즘
- 카카오코테
- 이것이자바다확인문제
- 백준9012
- 코딩테스트실력진단
- 백준평범한배낭
- 백준온라인저지
- java
- 스파르타코딩클럽
- 백준
- BOJ
- 이것이자바다
- 윤곽선검출
- 백준스택
- 백준가운데를말해요
- 운영체제
- KT포트포워딩
- 컴퓨터비전
- 백준10828
- 백준괄호
- 코드트리
- 딥러닝
- 가운데를말해요
- 이것이자바다9장
- 2019카카오코테
- Today
- Total
코딩하는 락커
Writing testing code: Benefits and Limitations 본문
This week, I wrote down the testing code at work, and It was the very first time to wrote testing code in Pytest and Django environments. Actually, I had experience writing testing code with Java and Spring frameworks, But it was because of the study of how to write testing code, rather than I truly needed it. This time I felt a strong need to write it down and I'm going to share that experience briefly in this article.
1. The benefits of writing testing code
First of all, The biggest benefit would be the assurance that the target method or function's action. If you are making a project in which the complexity is not that high, yes, you wouldn't feel this benefit that big. But the bigger your project gets, the higher the complexity of your project and you may feel that you're not assure your code is working well anymore.
From my side, the target action that I wanted to test was this.
It was troublesome switching Database and code to check related Objects2 was created whenever the code was updated. Furthermore, there were more than 10 target objects to test which made the complexity higher.
After I wrote down the testing code, It was succeded in simply executing the Pytest commander.
2. Challenges that I encountered
In the Progress writing the testing codes, necessary but the hard challenges were there. Let me show the difficult situation that I encountered.
Since the dependencies of the target Objects, I had to make other related objects to make the target object. And surely you should investigate the dependencies of target objects If you are not sure about the target. This is the biggest difficulty that I experienced in the whole process of writing testing code. I guess this hard situation is what most of the engineers who trying to write a testing code have encountered.
3. The limitation.
Although there is a lot of assurance that testing codes give us, definitely there are some limitations. And It was the possibility that it wouldn't give me the same result and performance "in another environment".
The environment we expect our codes to work is ultimately the production. But most of the testing environments, may not same as production in the aspect of the amount of data and everything. So the only thing we could expect for the testing codes is the action of the target.
Considering the above benefits, challenges, and limitations, I think the benefits of writing testing codes are not just the productivity that it gives to us, but also the progress to writing down on it. Investigating the target and studying the dependencies are meaningful itself. As a result, with this experience, I'll actively use it in my work.
'😎 일상 > 💻 개발 관련 주저리' 카테고리의 다른 글
회고와 락꿈사; 열정을 넘어 확신을 준 2023년 한해! (19) | 2024.01.01 |
---|---|
회고와 락꿈사; 스스로를 몹시도 갈고 닦았던 2022년, 한해! (4) | 2023.01.02 |
개발과 락꿈사; 개생개사(개발에 살고 개발에 죽는다는 뜻) (4) | 2022.12.10 |
당근마켓과 락꿈사; 당근 페이에게 버림받음 (물론 날 가진 적도 없음.) (1) | 2022.03.15 |
독서와 락꿈사; <오늘, 또 일을 미루고 말았다> (0) | 2022.01.29 |