Bugs in configuration files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shana07
    Contributor
    • Jan 2007
    • 280

    Bugs in configuration files?

    Good day! I wanna count lines of code of a game program that's completely written in java, and there are two configuration files (XML) in it too. Actually I wanna check defect density of this program. Questions:
    1. What are the config files for? I don't really know much about config files in a program. Please brief a general intro of it to me.
    2. Any possibilities of config bugs?
    3. Do I have to count lines of code of this config files too?

    Thanks a bunch
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Well, what is in the config files can vary a lot. You can have anything from a single boolean value to great parts of the program in them, so you'd better count them too.

    Also, to tell what exactly those config files do, we'd have to see them. But yes, they could contain bugs.

    So, if you want to understand what the XML files do exactly, you'll have to look at and understand the Java code. We can try to help you of course, but don't just post great chunks of code, ok?

    Greetings,
    Nepomuk

    Comment

    • shana07
      Contributor
      • Jan 2007
      • 280

      #3
      Ok. Could you please take a look at this code, just 5% of one of the configuration files, from a game program - freecol. What is the code for?

      Code:
      BODY{font:x-small 'Verdana';margin-right:1.5em} .c{cursor:hand} .b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none} .e{margin-left:1em;text-indent:-1em;margin-right:1em} .k{margin-left:1em;text-indent:-1em;margin-right:1em} .t{color:#990000} .xt{color:#990099} .ns{color:red} .dt{color:green} .m{color:blue} .tx{font-weight:bold} .db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier} .di{font:small Courier} .d{color:blue} .pi{color:blue} .cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888} .ci{font:small Courier;color:#888888} PRE{margin:0px;display:inline} <?xml version="1.0" encoding="UTF-8"  standalone="no" ?> 
        [URL="http://bytes.com/#"]-[/URL] <profiles version="[B]8[/B]">
         [URL="http://bytes.com/#"]-[/URL] <profile name="[B]FreeCol[/B]"  version="[B]8[/B]">
           <setting id="[B]org.eclipse.jdt.core.formatter.align_type_members_on_columns[/B]" value="[B]false[/B]" />  
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression[/B]" value="[B]16[/B]" /> 
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant[/B]" value="[B]16[/B]" /> 
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call[/B]" value="[B]16[/B]" /> 
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation[/B]" value="[B]16[/B]" /> 
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression[/B]" value="[B]16[/B]" /> 
      
          <setting id="[B]org.eclipse.jdt.core.formatter.alignment_for_binary_expression[/B]" value="[B]16[/B]" />

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        You have to read (and understand) the Java source code to understand all that xml crap; posting it here can't help you; although some of us are psychic and have crystal balls there are limits.

        kind regards,

        Jos

        Comment

        • Nepomuk
          Recognized Expert Specialist
          • Aug 2007
          • 3111

          #5
          All I can really tell from that code snippet is, that It was probably written with Eclipse and it certainly uses some of the Eclipse libraries. Apart from that, you'll just have to do as Jos sais - read and understand the code. Of course, it might be enough to limit your reading to the part where this XML file is read (and luckily searching through code is possible with most IDEs, even if there are several code files), but it might not.

          An alternative would be to just ask the developers. They might be so friendly as to explain it to you.

          Greetings,
          Nepomuk

          Comment

          • shana07
            Contributor
            • Jan 2007
            • 280

            #6
            Noted with many thanks....

            Comment

            Working...