Kev pab them nqi IntelliJ yog dab tsi?
Kev pab them nqi IntelliJ yog dab tsi?

Video: Kev pab them nqi IntelliJ yog dab tsi?

Video: Kev pab them nqi IntelliJ yog dab tsi?
Video: Vauv deev yuam kev niam tais #2, 1/4/2018 2024, Hlis ntuj nqeg
Anonim

Code kev pab them nqi tso cai rau koj pom ntau npaum li cas ntawm koj cov cai raug tua thaum lub sij hawm ntsuas chav tsev, yog li koj tuaj yeem nkag siab tias cov kev xeem no ua tau zoo npaum li cas. Cov cai hauv qab no kev pab them nqi runners muaj nyob rau hauv IntelliJ IDEA: IntelliJ IDEA code kev pab them nqi khiav (pom zoo).

Ib sab ntawm no, kuv yuav pom qhov kev pab cuam hauv IntelliJ li cas?

Yog tias koj xav rov qhib lub Kev pab them nqi lub qhov rais, xaiv Khiav | Qhia Code Kev pab them nqi Cov ntaub ntawv los ntawm cov ntawv qhia zaub mov tseem ceeb, lossis nias Ctrl + Alt + F6. Daim ntawv tshaj tawm qhia txog feem pua ntawm cov cai uas tau ua npog los ntawm kev xeem. Koj ua tau saib tus kev pab them nqi tshwm sim rau cov chav kawm, txoj kev, thiab kab.

Code Coverage txhais li cas? Code kev pab them nqi yog Kev ntsuas ntawm pes tsawg kab / blocks / arcs ntawm koj code raug tua thaum cov kev xeem automated khiav. Code kev pab them nqi yog tau sau los ntawm kev siv cov cuab yeej tshwj xeeb los ntsuas cov binaries ntxiv rau kev hu xov tooj thiab khiav tag nrho cov kev ntsuas tsis siv neeg tawm tsam cov khoom siv.

Hauv qhov no, kuv yuav siv li cas code kev pab them nqi hauv IntelliJ?

  1. Nyob rau hauv tej chaw/Preferences dialog Ctrl+Alt+S, xaiv Tsim, Ua, Deployment | Kev pab them nqi.
  2. Qhia seb yuav ua li cas cov ntaub ntawv khaws cia yuav raug ua tiav:
  3. Xaiv lub Activate Coverage View checkbox kom qhib qhov Coverage tool window tau txais.

Kuv yuav nrhiav tau qhov kev pab them nqi li cas?

Qhov yooj yim ntsuas ntawm Kev Pabcuam Code yog " Kev pab them nqi Yam khoom ", uas tuaj yeem los ntawm txhua yam peb tau suav thiab saib seb nws puas tau sim los tsis tau. Kev ntsuas ntawm Kev pab them nqi tuaj yeem txiav txim siab los ntawm cov qauv hauv qab no. Kev pab them nqi = Number of kev pab them nqi cov khoom siv / Tag nrho cov naj npawb ntawm kev pab them nqi cov khoom * 100%.

Pom zoo: