If you're a fresh graduate , Or new people who have worked for a year or two but can't do it , Is there any confusion ： Why did I write the code TL I've been dissatisfied with ？ Why work overtime a lot , Is also very hard , But the final output is not enough ？ If you have a similar question , So today's article is for you .
The theme of this article today is ： As a new employee or just changing profession Java Development of students , How to advance to become a reliable Engineer ？ You don't need to understand DDD、 You don't need to understand TDD, You don't need to understand distributed architecture design , Just meet the most basic requirements —— Be able to understand the needs 、 Be able to do simple design and output system documents 、 Can write BUG Less code , Can complete unit test and function test , And ultimately deliver functionality .
1. What to do before you start developing ？
When a new student gets a need , I have a look , Make a draft in your heart , I'm ready to do it , for example ： A few days ago, I asked my outsourcing classmates to do a department design , After a day , When I'm ready to accept the Department documents , I found that he had written a lot of code , however , sorry , The requirements are not clearly understood 、 The whole business process is not clear , As one can imagine , Most of the code written in this case is unusable .
After working for a long time, you will find that , Write code （ To do things ） It's actually the simplest part , The hard part is before you do it , Find out the following ：
- The context of the need （why）
- What problem to solve （Target）
- To what extent （ quality ）
- How many resources are there （ Time and manpower ）
- What is the process of the solution （ The whole idea ）
- What are the difficulties and mistakes （key point）
- How the changed point interacts with the old system （ Understanding of the old system ）
- How to ensure the smooth online function （ You can't roll back a release to deal with it ）
- How to verify that this change and development is in line with expectations （ The test case , Start with the end ）
- What to do , How long does everything take , What are the topological dependencies between these things （ Workload and hours assessment ）
The above things , That is, you need to review the requirements 、 Department review 、 Sufficient content should be prepared before the evaluation meeting , If before you do it , The above question can't be answered very well , It's burying thunder , Will pay more time cost and communication cost in the later stage of development . Of course , If you can answer the above questions before you start , So the development process for you and your TL Come on , It will be much clearer and simpler .
2. What should be paid attention to in the development process ？
Requirements in the development process , It's mainly about the quality of the code , There are four basic points ： Readability 、 modularization 、 Robustness, 、 Extensibility . Around the four points above , The basic requirements for code are ：
- Variable names should not be too arbitrary
- Function names should not be too arbitrary
- Functions can't be too long
- In a function, spaces are used to distinguish different logics
- The module is divided based on business function , Prior to the division of modules based on technical characteristics
- NPE、 An array 、 Exception capture and so on the most basic to deal with
- Use as much as possible apache Tool class of , Don't write it yourself
- Based on interfaces （API） Instead of implementing development
- Finish writing a method , Just add the single measurement
- After writing a module, do the next module test
- Single measurement must be carried with Assert, Can't give a fake （ How to write a good single test I have written before ）
- Single test tools include Mockito、PowerMock、JUnit、TestNG wait
- Functional testing should be automated as much as possible , I can't do it , You also need to document the steps of the test , Reduce the cost of execution .
If you can follow these points in the development process , I believe that the quality of the code you deliver will also be guaranteed . I'm not going to talk about the big words here , for example ：TDD、BDD、DDD etc. , All this is useless for the new students , Deliver available code as soon as possible 、 Maintainable code is more important than anything .
3. What minefields must be avoided ？
Everyone has grown up as a novice , So as TL And master , In fact, I understand the growth experience of new people , Can also accept a certain degree of error , Making mistakes is the best chance to accumulate experience , So-called “ learn from one's mistakes ”. But there are two points , It's the bottom line when I was a master ：
- Code without testing cannot be submitted , This is the basic bottom line as an engineer , Even if all those mentioned above are not well done , This is also an insurmountable bottom line . You might say , I'm not sure if the test is in place , No problem , Then measure it a few more times , If you don't know if you're right , Explain that I didn't think clearly when sorting out the test cases .
- Avoid making the same mistake , Mistakes are inevitable , But if the same mistakes are made repeatedly , It's really hard to grow . Here I have a little experience with my apprentice , It's similar to the wrong question set in school , Write down the mistakes you make in your development work , At the end of each project and requirement, do it review. This is very helpful , That's how I grew up myself .
I am currently doing risk control technology development in ant group , Fight against the black ash industry , Protect the content information security in ant ecology . We still have a lot of hc, Keep recruiting people , If you are interested in working or communicating with me , You can directly add my personal wechat .