ข้อจำกัดความรับผิดชอบ: ผลบวกเท็จ; ในทางปฏิบัตินี้มีประโยชน์สำหรับ "การสำรวจ" มากกว่าสำหรับ "การบังคับใช้"
การสั่งซื้อแนวตั้ง
โดยทั่วไปเราต้องการฟังก์ชั่นการพึ่งพาการโทรเพื่อชี้ไปในทิศทางลง นั่นคือฟังก์ชั่นที่เรียกว่าควรเป็นฟังก์ชันที่เรียกใช้ สิ่งนี้สร้างการไหลที่ดีลงโมดูลซอร์สโค้ดจากระดับสูงถึงระดับต่ำ เช่นเดียวกับในบทความในหนังสือพิมพ์เราคาดหวังว่าแนวคิดที่สำคัญที่สุดจะมาก่อนและเราคาดหวังให้พวกเขาแสดงด้วยรายละเอียดมลพิษน้อยที่สุด เราคาดว่ารายละเอียดระดับต่ำจะมาถึง สิ่งนี้ช่วยให้เราสามารถอ่านไฟล์ต้นฉบับได้รับส่วนสำคัญจากฟังก์ชั่น Frist ไม่กี่อย่างโดยไม่ต้องแช่ตัวในรายละเอียด
- รหัสสะอาดบทที่ 5, P84, Robert C. Martin, 2009

go install github . com / nikolaydubina / vertfn @ latest vertfn --verbose ./...
การปรับปรุงอัตราบวกเท็จเป็นสิ่งที่ดีเช่นกรณีต่อไปนี้:
Clean Code, บทที่ 5, ตัวอย่างรหัส WikiPageResponder.java
public class WikiPageResponder implements SecureResponder {
protected WikiPage page ;
protected PageData pageData ;
protected String pageTitle ;
protected Request request ;
protected PageCrawler crawler ;
public Response makeResponse ( FitNesseContext context , Request request )
throws Exception {
String pageName = getPageNameOrDefault ( request , "FrontPage" );
loadPage ( pageName , context );
if ( page == null )
return notFoundResponse ( context , request );
else
return makePageResponse ( context );
}
private String getPageNameOrDefault ( Request request , String defaultPageName )
{
String pageName = request . getResource ();
if ( StringUtil . isBlank ( pageName ))
pageName = defaultPageName ;
return pageName ;
}
protected void loadPage ( String resource , FitNesseContext context )
throws Exception {
WikiPagePath path = PathParser . parse ( resource );
crawler = context . root . getPageCrawler ();
crawler . setDeadEndStrategy ( new VirtualEnabledPageCrawler ());
page = crawler . getPage ( context . root , path );
if ( page != null )
pageData = page . getData ();
}
private Response notFoundResponse ( FitNesseContext context , Request request )
throws Exception {
return new NotFoundResponder (). makeResponse ( context , request );
}
private SimpleResponse makePageResponse ( FitNesseContext context )
throws Exception {
pageTitle = PathParser . render ( crawler . getFullPath ( page ));
String html = makeHtml ( context );
SimpleResponse response = new SimpleResponse ();
response . setMaxAge ( 0 );
response . setContent ( html );
return response ;
}
...
}