Ingénierie de prompt avancée
1. Les LLMs et les tests unitaires
-
La classe `URI`est une classe Java développée par IBM et ensuite donnée à la fondation Eclipse. Elle permet la représentation d’identifiants uniformes de ressources, ou tout simplement URI.
-
Voici une méthode extraite de cette classe :
public static URI createURI(String uri)
{
return createURIWithCache(uri);
}
|
Maintenant, considérez cette même méthode, mais cette fois avec es commentaires
/**
* Static factory method based on parsing a URI string, with
* <a href="#device_explanation">explicit device support</a> and handling
* for <a href="#archive_explanation">archive URIs</a> enabled. The
* specified string is parsed as described in <a
* href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>, and an
* appropriate <code>URI</code> is created and returned. Note that
* validity testing is not as strict as in the RFC; essentially, only
* separator characters are considered. This method also does not perform
* encoding of invalid characters, so it should only be used when the URI
* string is known to have already been encoded, so as to avoid double
* encoding.
*
* @exception java.lang.IllegalArgumentException if any component parsed
* from <code>uri</code> is not valid according to {@link #validScheme
* validScheme}, {@link #validOpaquePart validOpaquePart}, {@link
* #validAuthority validAuthority}, {@link #validArchiveAuthority
* validArchiveAuthority}, {@link #validDevice validDevice}, {@link
* #validSegments validSegments}, {@link #validQuery validQuery}, or {@link
* #validFragment validFragment}, as appropriate.
*/
public static URI createURI(String uri)
{
return createURIWithCache(uri);
}
|
Le code complet de la classe URI est disponible sur GitHub.
|