Re: readable source code [Re: OVC-discuss Digest, Vol 37, Issue 6]

From: Richard C. Johnson <dick_at_iwwco_dot_com>
Date: Fri Nov 02 2007 - 17:33:19 CDT

Ham,
   
  Far more people could understand the code you cited than can truly understand the inner workings of the Microsoft Windows binary by looking at the zeros and ones. The idea is to have more transparency rather than less, not to throw hands in the air and bow in the direction of Richmond, WA. No one I know talks about "correctness" as a final solution. Proving code correct involves either a tautology or a leap of faith.
   
  Rather, being able to actually see the source code in use after being compiled allows white box testing not remotely possible if one has no concrete notion what is taking place beneath the surface. You don't test your way to correctness, either; you put the code at risk of failure to estmate the odds on it working under use under the conditions you simulate.
   
  Even the notion of what applications are running on Windows is hidden, with vast potential for mischief. I am surprised that you consider the status quo a model for anything approaching correctness. But, if you really prefer commercial code and trust MS to do it right, all the best of luck to you.
   
  -- Dick
  
Hamilton Richards <hrichrds@swbell.net> wrote:
  At 10:45 AM -0700 2007/11/2, ovc-discuss-request@listman.sonic.net wrote:
>
>Message: 2
>Date: Fri, 2 Nov 2007 10:45:52 -0700 (PDT)
>From: "Richard C. Johnson"
>Subject: Re: [OVC-discuss] Representative Holt's OWN WORDS [Re:
> OVC-discuss Digest, Vol 36, Issue 9]
>To: Open Voting Consortium discussion list
>
>Message-ID: <479430.49366.qm@web408.biz.mail.mud.yahoo.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Stuart,
>
>Here is some example Open Source code from the OpenScan system. See
>how difficult you think it would be to figure out. My own thought
>is that most people could correctly understand what is being coded
>and could also see that no subroutine doing nasty things was hidden
>in the code:
>
>
> OK-2007-09-1
>
>
>
>
>
> Brad Henry
> John Wayne
> Bill Okapi
> Jane Smith
>
>
>
>
>
>***************************
>
>I do believe that there are enough people who could read such code
>to make such Open Source a reasonable approach to increased
>transparency of elections. How many people can read the above and
>understand it? Quite a few, I would think. I admit, Open Source
>drivers for a scanner are more difficult, but I can read them even
>if it would be hard for me to write them myself.
>
>-- Dick
>

Sure, many people could read code like that, if by "read" you mean
"recognize most of the words." But how many people could explain how
one could determine whether that code is correct?

For a more realistic example, spend a minute perusing the Java code
appended below
.
Then give us an estimate of the fraction of the population that could
formulate a coherent argument for its correctness. How many could
even give a coherent definition of "correctness"?

Thanks,

--Ham

public ActionForward execute(ActionMapping actionmapping, ActionForm
actionform, HttpServletRequest httpservletrequest,
HttpServletResponse httpservletresponse)
70 throws Exception
71 {
72 String forwardName = "defaultPage";
73 try {
74
75 //pl = new PropertyLoader
("http://localhost:8080/connecticutVotingDemo/properties/application.properties");
76 pl = new PropertyLoader
("http://localhost:8080/connecticutVotingDemo/properties/application.properties");
77 prop = pl.getCache();
78 } catch (Exception e) {
79 e.printStackTrace();
80 }
81
82 try
83 {
84 CountingForm countingform = (CountingForm)actionform;
85 HashMap hashmap = new HashMap();
86 BallotVO ballotvo = new BallotVO();
87 MessageBean messagebean = new MessageBean();
88 httpservletrequest.setAttribute("messageBean", messagebean);
89 makeWarning(httpservletrequest, "Welcome to Counting!
Please click on the given below enabled button to process the
counting...! ");
90 String countingType = countingform.getCountingType();
91 logSB.append("CountingType "+countingType+"\r\n");
92 if(countingType.equals("ballotToEML440")) {
93 System.out.print("ballotToEML440");
94 String ballotLookupFolder =
prop.getProperty("ballotLookupFolder");
95 System.out.println("ballotLookupFolder
"+ballotLookupFolder);
96 //parse and map ballot look up
97 parseBallotLookup(ballotLookupFolder);
98
99 try {
100 // Ballot XML Parser
101 HashMap listOfBallotMap = new HashMap();
102 String ballotFolder =
prop.getProperty("ballotFolder");
103 // Reading list of BALLOT XML file
104 listOfBallotMap =
readListofFiles(ballotFolder);
105 if (listOfBallotMap != null) {
106
System.out.println("listOfEMLXMLs " +
listOfBallotMap.size());
107 Set keySet = listOfBallotMap.keySet();
108 if (keySet != null) {
109 Iterator bIt =
keySet.iterator();
110 while (bIt.hasNext()) {
111 String key =
(String) bIt.next();
112 xmlString =
(String) listOfBallotMap.get(key);
113 //
System.out.println("Ballot XML size "+ xmlString.toString());
114 BallotXMLMap
ballotMap = new BallotXMLMap();
115 HashMap
ballotXMLMap = ballotMap.getXMLMap(xmlString.toString().trim());
116
System.out.println("\r\n\r\nballotXMLMap Size
"+ballotXMLMap.size()
117
+" ballotLookupXMLMap "+ballotLookupXMLMap.size());
118
logSB.append("\r\n\r\nballotXMLMap Size "+ballotXMLMap.size()
119
+" ballotLookupXMLMap "+ballotLookupXMLMap.size());
120
writeFile(logSB.toString());
121
//ballotVO.setBallotData(ballotXMLMap);
122 xmlString = null;
123 // Generate
EML440 XML file
124
generateEML440(ballotXMLMap, ballotLookupXMLMap);
125
ballotXMLMap=new HashMap();
126
//System.out.println("\r\n\r\nballotXMLMap Size
"+ballotXMLMap.size());
127
128 }
129 }
130 }
131
ballotvo.setTransactionDetails("Ballot to EML440 has been
converted successfully...!");
132 countingform.setCountingType("eml440To510");
133 } catch (Exception e) {
134 System.out.println("Exception in
Ballot..." + e.getMessage());
135 ballotvo.setTransactionDetails(e.toString());
136
137 }
138 }
139
140 if(countingType.equals("eml440To510"))
141 {
142 System.out.println("eml440To510?");
143 logSB.append("inside the eml440To510 if condition\r\n");
144 countingform.setCountingType("eml510To520");
145 HashMap emlXMLMap = new HashMap();
146 emlXMLMap = getEMLXMLCountingDataMap();
147 System.out.println("emlXMLMap "+emlXMLMap.size());
148 generateEML510(emlXMLMap);
149 logSB.append("EML440 to EML510 has been converted
successfully...!");
150 writeFile(logSB.toString());
151 ballotvo.setTransactionDetails("EML440 to EML510
has been converted successfully...!");
152 doRankedChoice();
153 }
154 if(countingType.equals("eml510To520"))
155 {
156 System.out.print("eml510To520");
157 countingform.setCountingType("done");
158 forwardName = "success";
159 parseCounting410Lookup();
160 parse510XML();
161 generateEML520();
162 makeWarning(httpservletrequest, "");
163 }
164 if(httpservletrequest.getParameter("countingType") !=
null &&
httpservletrequest.getParameter("countingType").equals("done"))
165 {
166 makeWarning(httpservletrequest, "");
167 System.out.print("Inside done...!!!");
168 countingform.setCountingType("done");
169 }
170 System.out.println("countingType " + countingType);
171 System.out.println("Forward Status " + forwardName);
172 writeFile(logSB.toString());
173 }
174 catch(Exception exception1)
175 {
176 exception1.printStackTrace();
177 writeFile(logSB.toString());
178 }
179 return actionmapping.findForward(forwardName);
180 }

-- 
------------------------------------------------------------------
Hamilton Richards, PhD Department of Computer Sciences
Senior Lecturer (retired) The University of Texas at Austin
ham@cs.utexas.edu hrichrds@swbell.net
http://www.cs.utexas.edu/users/ham/richards
------------------------------------------------------------------
_______________________________________________
OVC-discuss mailing list
OVC-discuss@listman.sonic.net
http://lists.sonic.net/mailman/listinfo/ovc-discuss
By sending email to the OVC-discuss list, you thereby agree to release the content of your posts to the Public Domain--with the exception of copyrighted material quoted according to fair use, including publicly archiving at http://gnosis.python-hosting.com/voting-project/

_______________________________________________
OVC-discuss mailing list
OVC-discuss@listman.sonic.net
http://lists.sonic.net/mailman/listinfo/ovc-discuss
By sending email to the OVC-discuss list, you thereby agree to release the content of your posts to the Public Domain--with the exception of copyrighted material quoted according to fair use, including publicly archiving at http://gnosis.python-hosting.com/voting-project/
==================================================================
= The content of this message, with the exception of any external
= quotations under fair use, are released to the Public Domain
==================================================================
Received on Fri Nov 30 23:17:06 2007

This archive was generated by hypermail 2.1.8 : Fri Nov 30 2007 - 23:17:31 CST