[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-701159-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-701159-en":130,"doc-similar-701159":161},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","lab-2-javadoc-junit-debugging","Lab 2 - Javadoc, JUnit, & Debugging","","Lab 2 focuses on creating clear Java documentation with Javadoc and writing reliable unit tests using JUnit. It explains how Javadoc generates HTML from structured comments, including the required comment format and how to write effective first sentences and detailed descriptions when needed. The material covers common comment practices, key Javadoc tags like @param, @return, and @throws, plus guidance for integrating Javadoc generation in Eclipse. It also highlights how to design small, independent unit tests and fix code iteratively.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/lab-2-javadoc-junit-debugging/701159/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/lab-2-javadoc-junit-debugging/701159.png","ImageObject",300,407,{"name":42,"@type":43},"hdkawk","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-18","2026-11-12",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How does Javadoc generate documentation?","Question",{"text":63,"@type":64},"Javadoc creates actual HTML web pages generated from structured doc comments placed in the code. It helps keep documentation consistent with the code.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What are the required rules for Javadoc doc comments?",{"text":68,"@type":64},"Doc comments start with /** and end with */. The delimiters should be on their own lines, additional lines must begin with *, and comments can include HTML tags.",{"name":70,"@type":61,"acceptedAnswer":71},"How should unit tests be designed for easier debugging?",{"text":72,"@type":64},"Write tests as small as possible. If one test checks multiple things, split it into separate tests so a failure indicates exactly what is broken.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},701159,1794523820,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":55,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":33,"preview_urls":145},3985747859855,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Documentation Unit Testing JUnit Debugging  \nMeme Credit: Reddit user u/sachintripathi007  \nLab 2: Javadoc, JUnit, & Debugging  \nDocumentation Unit Testing JUnit Debugging  \nLab 2: Javadoc, JUnit, & Debugging  \nCS 2112 Fall 2020  \nSeptember 14 / 16, 2020  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Javadoc Overview |  |  |\n| Javadoc Overview |  |  |\n\nI Javadoc is a tool for creating html documentation I The documentation is generated from comments I It produces actual html web pages  \nI Helps keep documentation consistent with the code  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Javadoc Overview |  |  |\n| Doc Comments |  |  |\n\nI Doc comments start with /** and end with */ . I The /** and */ should be on their own lines I Additional lines need to start with * I Comments can have html tags  \n1  \n2  \n3  \n/* *  \n* This is a javadoc comment */  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Javadoc Overview |  |  |\n| Writing Good Docs |  |  |\n\nI First sentence: high level overview (no 􀀍u􀀋)  \nI Bad: This method is a method that computes the square root of a number  \nI Good: Computes the square root  \nI Go into detail if necessary after 􀀌rst sentence I Don't repeat things in the method declaration  \nI Bad: The 􀀌rst argument is an integer I Document preconditions and invariants I Cover Edge Cases!  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Tags |  |  |\n| Javadoc Tags |  |  |\n\n1  \n2  \n3  \n4  \n5  \n6  \n7  \n8  \n9  \n10  \nI Use tags to help Javadoc parse your comments I Tags start with a @ and are case sensitive I It must be at the beginning of the line  \n/* *  \n* Prints the kth element of the list *  \n* @author Alexander Lee  \n* @param list The list whose element is to be printed  \n* @param k The index of the item to be printed */  \npublic void printK ( List list , int k ) {  \n}  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Tags |  |  |\n| Important Tags |  |  |\n\nSome important tags  \nI @param: describes a speci􀀌c parameter I @return: describes the return value I @throws: describes exceptions it throws  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Javadoc and Eclipse |  |  |\n| Javadoc and Eclipse |  |  |\n\nI To generate the doc, Project > Generate Javadoc . . . I Eclipse automatically generates Javadoc comments if the  \nmethod signature is already written  \nI Can con􀀌gure Eclipse to complain about missing Javadoc comments: Window (or Eclipse) > Preferences . . . > Java > Compiler > Javadoc  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Unit Testing Overview |  |  |\n| What's a `Unit' Test? |  |  |\n\nWhen writing test cases, try to make them as small as possible. If you have [e.g. one](e.g. one) test that checks three things, consider breaking it into three tests that each check one thing.  \nThis way, if a test fails, you know exactly what is broken. I Unit = Usually one method or a small group of methods I Try to keep units as independent as possible  \nI Test and 􀀌x units as you go  \nLab 2: Javadoc, JUnit, & Debugging  \n\n| Documentation\u003Cbr>| Unit Testing\u003Cbr>\u003Cbr>| JUnit Debugging\u003Cbr>\u003Cbr>|\n| --- | --- | --- |\n| Unit Testing Overview |  |  |\n| Why Write Tests? |  |  |\n\n\\Manual testing works just 􀀌ne!\"  \n- Famous Last Words  \nLab 2: Javadoc, JUnit, & Debugging","cbCaiis3WJDeVojU","https://ap.wps.com/l/cbCaiis3WJDeVojU","pdf",1565748,32,"English","# Javadoc Overview\n## Documentation generation from comments\n## Doc comments syntax and rules\n## Writing good documentation\n## Javadoc tags\n## Important Javadoc tags (@param, @return, @throws)\n## Javadoc and Eclipse\n# Unit Testing Overview\n## What is a unit test?\n## Why write tests?","[{\"question\":\"How does Javadoc generate documentation?\",\"answer\":\"Javadoc creates actual HTML web pages generated from structured doc comments placed in the code. It helps keep documentation consistent with the code.\"},{\"question\":\"What are the required rules for Javadoc doc comments?\",\"answer\":\"Doc comments start with /** and end with */. The delimiters should be on their own lines, additional lines must begin with *, and comments can include HTML tags.\"},{\"question\":\"How should unit tests be designed for easier debugging?\",\"answer\":\"Write tests as small as possible. If one test checks multiple things, split it into separate tests so a failure indicates exactly what is broken.\"}]","Lab 2 - Javadoc, JUnit, & Debugging | PDF",81,[146,150,153,157],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/f03eeb67b1f25e150367006bfb9c2dba.webp",983,736,{"page_no":26,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/243181d1dc33a21d78b4f1fa4867ca9f.webp",982,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/9c65fdc4e697ad047f86a65b9cb0d69f.webp",981,735,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/dbf910385093e5c55d30dacbd861dd41.webp",980,734,{"list":162,"token":11},[163,169,175,181,187,193,198,204,210,216],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":55,"category_name":29,"create_tm":168},701156,"JUnit Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051926/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=X%2BBzJDLq7Ng3KiKdgvZILcYlK7Y%3D","junit-tutorial",1794523814,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":33,"category_name":29,"create_tm":174},701154,"Les25 - Introduction to unit testing - Unit Testing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051900/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=QE1Fpr53%2Bo0uh2Mj6Qluwtmctv0%3D","les25-introduction-to-unit-testing-unit-testing",1794523810,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":55,"category_name":29,"create_tm":180},701158,"JUnit Tutorial - Beginner Guide - Java Unit Testing Framework","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051946/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=ktsD9Be%2BicPtf72ZxnyvclecJmU%3D","junit-tutorial-beginner-guide-java-unit-testing-framework",1794523817,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":33,"category_name":29,"create_tm":186},701153,"Selenium + JUnit 5 - The Perfect Match - Meetup 2021","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051883/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=hrALXjAeZcqubERhvp2Ig5%2BmfHA%3D","selenium-junit-5-the-perfect-match-meetup-2021",1794523807,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":30,"category_name":29,"create_tm":192},689161,"EPIC - User's Guide - Installation and Debugger Setup","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001528196/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=1pKVDMTgd1IRX3JbhTfgeS4z7BM%3D","epic-users-guide-installation-and-debugger-setup",1794098235,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":30,"category_name":29,"create_tm":186},701152,"JUnit 5 User Guide - Version 5.12.2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012051873/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=X1QXNzCHgr5DtE5BPlwjdvGRl%2FE%3D","junit-5-user-guide-version-5122",{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":33,"category_name":29,"create_tm":203},685838,"WEB TECHNOLOGIES UNIT-I - Introduction to HTML - HTML Tags","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000223080/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=9YgAzsftlsY%2BxYs%2F6hpQVZ2t%2Bqo%3D","web-technologies-unit-i-introduction-to-html-html-tags",1794019250,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":30,"category_name":29,"create_tm":209},689120,"DIPLOMA IN COMPUTER APPLICATION - WEB-DESIGN - Block 1 - HYPER TEXT MARKUP LANGUAGE (HTML)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001516703/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=SJOblD9mZLvVWF3vpJB7N0jwuNQ%3D","diploma-in-computer-application-web-design-block-1-hyper-text-markup-language-html",1794097032,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":33,"category_name":29,"create_tm":215},697982,"Essential HTML Tags - Page 1 - Apply appropriate HTML tags","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010150459/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=hEEQx1lr8%2FIQ%2F8RAbUstvLSDEv8%3D","essential-html-tags-page-1-apply-appropriate-html-tags",1794446726,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":221,"category_name":29,"create_tm":222},346438,"Introduction to HTML - Basic Concepts and Examples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911195333/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796119739&Signature=6ETOYSvJM7jcJNALmi7bWIYMEtk%3D","introduction-to-html-basic-concepts-and-examples",12,1790061454]