or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Day 4 Q&A
Icebreaker questions
OO and Development
Q: My programming is mostly limited to object-oriented programming. What is the main benefit of this approach, and what are the benefits of other methods? Maybe this is too broad a question, but perhaps you have any useful material to read up on. I can imagine this could be a nice addition to the course.
by Dung Nguyen, Stephen Wong Free ebook
Q: What is difference between private, protected and package private?
Testing
Q: If you have functions that implicitly rely upon another function, how do you perform a unit test then? Is it better practice to dummy the implicit function, or make it an integration test?
Q:
In your example, you test reverse for one word. I assume one would want to test the reverse for different words. Would one create a different test for each word or would one combine them into one test?
pytest
you can read about it here: https://docs.pytest.org/en/6.2.x/parametrize.htmlQ: How do you set up test? do you create a test function inside the main function or should it be outside the function that is testing like in the exercise? Should we put the test function inside one script or multiple test in different .py?
Q: I never used an IDE, can you suggest one?
Q:When are unit tests only enough?
Q: How unit tests related to coverage?
Q: Are you suppose to write unit test along with the development or after? At the beginning there is a lot of prototyping and changes
Q: Should a unit test multiple conditions? The one in the exercise used only one world for instance, should one generally try many words?
Q: In case of the calculator, how many additions should you test to be sure that additions works?
Q: In the calculator example, would e.g.. exception handling (entering a letter instead of number) be part of unit testing?
Q: What is pros and cons for unit test compared with other types of test?
Q: Will you push the refactored file to repo?
Q: In testesB the test of on a function is based on another funciont, mostly the find funciotn. So if the find fail also all other tests will fail. For instance I changed only the add function but the test failed because I didn't change the find. Shouldn't one test one function at the time?
Q: (Mocking) If my program reads and writes files, I should use mocking to simulate this or what do you recomment?
Continuous integration session
link to website: https://uppmax.github.io/programming_formalism-automated_testing/
Q: Have you used GitHub actions before?
Q:
General questions
pytest
(which is external) is more or less the standard. Letting GitHub run the tests as with nbdev relates to continuous integration which we will talk about from 14:30.Questions above this line
Day 4 feedback